|
|
@@ -10,6 +10,7 @@
|
|
|
#include "array.h"
|
|
|
#include "string_id.h"
|
|
|
#include "string_utils.h"
|
|
|
+#include "fixed_string.h"
|
|
|
#include <string.h> // memmove
|
|
|
|
|
|
namespace crown
|
|
|
@@ -26,10 +27,13 @@ public:
|
|
|
DynamicString& operator+=(const DynamicString& s);
|
|
|
DynamicString& operator+=(const char* s);
|
|
|
DynamicString& operator+=(const char c);
|
|
|
+ DynamicString& operator+=(const FixedString& s);
|
|
|
+
|
|
|
///
|
|
|
DynamicString& operator=(const DynamicString& s);
|
|
|
DynamicString& operator=(const char* s);
|
|
|
DynamicString& operator=(const char c);
|
|
|
+ DynamicString& operator=(const FixedString& s);
|
|
|
|
|
|
bool operator<(const DynamicString& s) const;
|
|
|
bool operator==(const DynamicString& s) const;
|
|
|
@@ -100,6 +104,12 @@ inline DynamicString& DynamicString::operator+=(const char c)
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
+inline DynamicString& DynamicString::operator+=(const FixedString& s)
|
|
|
+{
|
|
|
+ array::push(_data, s.data(), s.length());
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
inline DynamicString& DynamicString::operator=(const DynamicString& s)
|
|
|
{
|
|
|
_data = s._data;
|
|
|
@@ -121,6 +131,13 @@ inline DynamicString& DynamicString::operator=(const char c)
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
+inline DynamicString& DynamicString::operator=(const FixedString& s)
|
|
|
+{
|
|
|
+ array::clear(_data);
|
|
|
+ array::push(_data, s.data(), s.length());
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
inline bool DynamicString::operator<(const DynamicString& s) const
|
|
|
{
|
|
|
return strcmp(c_str(), s.c_str()) < 0;
|