sources/mystring.h

changeset 179
7fc34735178e
parent 158
de7574d292ad
child 182
20ca0a6be175
--- 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>;
 
 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<char> &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<String>
-{
-public:
-	StringList();
-	StringList(int numvalues);
-	StringList(const List<String>& 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<String>(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<String>& other) :
-	List<String>(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.

mercurial