diff -r 248fba6d1e76 -r 7fc34735178e sources/mystring.h --- a/sources/mystring.h Wed Jan 27 12:38:00 2021 +0200 +++ b/sources/mystring.h Wed Jan 27 13:02:51 2021 +0200 @@ -37,6 +37,7 @@ BEGIN_ZFC_NAMESPACE +using StringList = std::vector; class String { @@ -86,13 +87,11 @@ void replace(int position, int amount, const String &text); String right(int length) const; void shrinkToFit(); - class StringList split(const String &delimeter) const; - class StringList split(char delimeter) const; + StringList split(const String &delimeter) const; + StringList split(char delimeter) const; void __cdecl sprintf(const char* fmtstr, ...); bool startsWith(const String &other) const; const std::string& stdString() const; - void strip(char unwanted); - void strip(const List &unwanted); const unsigned char* toBytes() const; double toDouble(bool* ok = nullptr) const; float toFloat(bool* ok = nullptr) const; @@ -134,16 +133,7 @@ std::string m_string; }; - -class StringList : public List -{ -public: - StringList(); - StringList(int numvalues); - StringList(const List& other); - String join(const String& delim); -}; - +String join_string_list(const StringList& strings, const String& delim); inline bool operator==(const char* a, const String& b); inline String operator+(const char* a, const String& b); @@ -563,25 +553,6 @@ } /*! - * \brief Constructs an empty string list. - */ -inline StringList::StringList() {} - -/*! - * \brief Constructs a string list containing \c numvalues empty strings. - * \param numvalues Amount of empty strings to fill. - */ -inline StringList::StringList(int numvalues) : - List(numvalues) {} - -/*! - * \brief Constructs a string list from another list of strings. - * \param other The list of strings to use for construction. - */ -inline StringList::StringList(const List& other) : - List(other) {} - -/*! * \brief An \c operator== implementation that allows a char-array to be at the left side of a string comparison * with a \c String. * \param one A char-array representation of a string to compare.