sources/coloredline.h

branch
protocol5
changeset 195
be953e1621d9
parent 150
37db42ad451a
parent 191
2e6cbacafdc7
--- a/sources/coloredline.h	Wed Jan 27 12:41:50 2021 +0200
+++ b/sources/coloredline.h	Wed Jan 27 19:48:41 2021 +0200
@@ -1,5 +1,5 @@
 /*
-	Copyright 2014 - 2016 Teemu Piippo
+	Copyright 2014 - 2021 Teemu Piippo
 	All rights reserved.
 
 	Redistribution and use in source and binary forms, with or without
@@ -49,27 +49,20 @@
 	NUM_COLORS
 };
 
-// -------------------------------------------------------------------------------------------------
-//
-enum
-{
-	RLINE_ON_COLOR = 256,
-	RLINE_OFF_COLOR = 264,
-	RLINE_ON_BOLD = 272,
-	RLINE_OFF_BOLD
-};
+constexpr int RLINE_ON_COLOR = 256;
+constexpr int RLINE_OFF_COLOR = 264;
+constexpr int RLINE_ON_BOLD = 272;
+constexpr int RLINE_OFF_BOLD = 273;
 
-// -------------------------------------------------------------------------------------------------
-//
 class ColoredLine
 {
 public:
 	ColoredLine();
 
-	const Vector<int>& data() const { return m_data; }
+	const std::vector<int>& data() const { return m_data; }
 	int length() const { return m_length; }
 	void addChar(char ch);
-	void addString(const String& msg);
+	void addString(const std::string& msg);
 	void finalize();
 	int rows(int cols) const;
 
@@ -77,14 +70,14 @@
 	void activateColor(Color color, bool bold);
 	void setColor(Color a, bool on);
 
-	Vector<int> m_data;
+	std::vector<int> m_data;
 	int m_length;
 	bool m_final;
 	Color m_activeColor;
 	bool m_boldActive;
 	int m_colorCodeStage;
-	String m_string;
-	String m_incomingColorName;
+	std::string m_string;
+	std::string m_incomingColorName;
 };
 
 END_ZFC_NAMESPACE

mercurial