|
#include <CStrings.h>
Public Member Functions | |
| CStrings () | |
| Default constructor. | |
| CStrings (const CStrings &src) | |
| Copy constructor. | |
| CStrings (const std::string &src, const char *separator) | |
| Constructor from a string with elements separated by a delimiter string. | |
| CStrings (const char *src, const char *separator) | |
| Constructor from a string with elements separated by a delimiter string. | |
| void | fromString (const std::string &src, const char *separator) |
| Assigns strings from a string with elements separated by a delimiter string. | |
| std::string | asString (const char *separator) const |
| Makes string from own strings separated by a delimiter string. | |
| int | indexOf (std::string s) const |
| Returns an index of the string in strings, or -1 if not found. | |
| void | saveToFile (std::string fileName) const throw (CException) |
| Saves strings to file. String ids are discarded. | |
| void | loadFromFile (std::string fileName) throw (CException) |
| Loads strings from file. String ids are not loaded. | |
| int32_t | argument () const |
| Returns user data as integer. | |
| void | argument (int32_t d) |
| Sets user data as integer. | |
| void | remove (uint32_t i) |
| Removes a string from vector. | |
General string list. Based on vector<idstring>. Stores strings with (optional) integer Ids. Includes several extra methods to construct it from string or load/save from/to file.
| sptk::CStrings::CStrings | ( | const std::string & | src, | |
| const char * | separator | |||
| ) | [inline] |
Constructor from a string with elements separated by a delimiter string.
| src | const std::string&, a source string | |
| separator | const char *, a separator string |
| sptk::CStrings::CStrings | ( | const char * | src, | |
| const char * | separator | |||
| ) | [inline] |
Constructor from a string with elements separated by a delimiter string.
| src | const char *, a source string | |
| separator | const char *, a separator string |
| void sptk::CStrings::argument | ( | int32_t | d | ) | [inline] |
Sets user data as integer.
| d | int, new value for user data |
| std::string sptk::CStrings::asString | ( | const char * | separator | ) | const |
Makes string from own strings separated by a delimiter string.
| separator | const char *, a separator string |
Referenced by sptk::CDirectoryDS::pattern().
| void sptk::CStrings::fromString | ( | const std::string & | src, | |
| const char * | separator | |||
| ) | [inline] |
Assigns strings from a string with elements separated by a delimiter string.
| src | const std::string&, a source string | |
| separator | const char *, a separator string |
Referenced by sptk::CDirectoryDS::pattern().
| int sptk::CStrings::indexOf | ( | std::string | s | ) | const |
Returns an index of the string in strings, or -1 if not found.
| s | std::string, a string to find |
| void sptk::CStrings::loadFromFile | ( | std::string | fileName | ) | throw (CException) |
Loads strings from file. String ids are not loaded.
| fileName | std::string, the name of the file |
| void sptk::CStrings::remove | ( | uint32_t | i | ) | [inline] |
Removes a string from vector.
| i | uint32_t, string index in the vector |
| void sptk::CStrings::saveToFile | ( | std::string | fileName | ) | const throw (CException) |
Saves strings to file. String ids are discarded.
| fileName | std::string, the name of the file |