59 std::copy(lines.begin(), lines.end(), std::back_inserter(
m_strings));
103 bool caseSensitive =
true)
const;
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
The virtual base class which provides a unified interface for all persistent objects in MRPT.
A class for storing a list of text lines.
CStringList()
Default constructor (empty string list)
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,...
bool get_bool(const std::string &keyName)
Returns the value of the given key ("key=value").
CStringList & operator<<(const std::string &s)
An alternative way of adding strings to the list.
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.
double get_double(const std::string &keyName)
Returns the value of the given key ("key=value").
void add(const std::string &str)
Appends a new string at the end of the string list.
void get(size_t index, std::string &outText) const
Returns one string from the line list.
void loadFromFile(const std::string &fileName)
Load the string list from a file.
void remove(size_t index)
Delete the element at a given position (0=first element)
std::deque< std::string > m_strings
The internal list of strings.
size_t size() const
Returns the number of text lines in the list.
void clear()
Clear the whole list.
int get_int(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 '\r ' characters for newlines.
CStringList(const std::deque< std::string > &lines)
Explicit constructor from deque<string>
void saveToFile(const std::string &fileName) const
Save the string list to a file.
std::string operator()(size_t index) const
Returns one string from the line list.
std::string get_string(const std::string &keyName)
Returns the value of the given key ("key=value").
CStringList(const std::vector< std::string > &lines)
Explicit constructor from vector<string>
void set(size_t index, const std::string &str)
Overwrites an existing position with a new value (0=first elements)
float get_float(const std::string &keyName)
Returns the value of the given key ("key=value").
void setText(const std::string &inText)
Fills the string list by parsing a single string with '\r', ' ', or '\r ' characters indicatng newlin...
GLsizei const GLfloat * value
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.