59 std::copy(lines.begin(), lines.end(), std::back_inserter(
m_strings));
95 void remove(
size_t index);
103 bool caseSensitive =
true)
const;
void insert(size_t index, const std::string &str)
Inserts a new item at a given position (0=insert at the beggining,1=put into the second position...
CStringList()
Default constructor (empty string list)
CStringList(const std::vector< std::string > &lines)
Explicit constructor from vector<string>
The virtual base class which provides a unified interface for all persistent objects in MRPT...
bool find(const std::string &compareText, size_t foundIndex, bool caseSensitive=true) const
Looks for a given string in the list, and returns its index, or returns "false" otherwise.
bool get_bool(const std::string &keyName)
Returns the value of the given key ("key=value").
float get_float(const std::string &keyName)
Returns the value of the given key ("key=value").
std::string getText() const
Returns the whole string list as a single string with ' ' characters for newlines.
std::string get_string(const std::string &keyName)
Returns the value of the given key ("key=value").
std::string operator()(size_t index) const
Returns one string from the line list.
A class for storing a list of text lines.
void clear()
Clear the whole list.
void setText(const std::string &inText)
Fills the string list by parsing a single string with '', ' ', or ' ' characters indicatng newlines...
CStringList & operator<<(const std::string &s)
An alternative way of adding strings to the list.
GLsizei const GLchar ** string
size_t size() const
Returns the number of text lines in the list.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
double get_double(const std::string &keyName)
Returns the value of the given key ("key=value").
int get_int(const std::string &keyName)
Returns the value of the given key ("key=value").
GLsizei const GLfloat * value
void saveToFile(const std::string &fileName) const
Save the string list to a file.
std::deque< std::string > m_strings
The internal list of strings.
CStringList(const std::deque< std::string > &lines)
Explicit constructor from deque<string>
void loadFromFile(const std::string &fileName)
Load the string list from a file.
void add(const std::string &str)
Appends a new string at the end of the string list.