#include <mlStringLineMultiField.h>

Public Member Functions | |
| StringLineMultiField (const std::string &name="") | |
| Constructor. See constructor of MultiField for documentation. | |
| void | setStringValue (const std::string &value) |
| Same as setStringValue(const std::string &value, char sep) using the "\n" as value for sep; additional carriage return '' characters will silently be removed from the strings. | |
| void | setStringValue (const std::string &value, const std::string &sep) |
| Subdivides value at all positions of sep and stores all values in the internal vector. | |
| void | removeSubString (const std::string &str) |
| Removes the character sequence str from each string element of the internal vector. | |
| void | removeElements (const std::string &str=std::string()) |
| Removes all entries equal to str; default is an empty string to remove all empty entries. | |
| std::string | getStringValue () const |
| Same as getStringValue(StringLineMultiField::DefaultLineSeparator). | |
| std::string | getStringValue (const std::string &sep) const |
| Returns a string containing the concatenation of all values from the internal vector separated by the StringLineMultiField::DefaultLineSeparator. | |
| ML_CLASS_HEADER (StringLineMultiField) | |
| Macro to implement the interface for the Runtime Type System and for the initialization of this class. | |
Static Public Attributes | |
| static const std::string | DefaultLineSeparator |
| The default line separator used for line endings when converting the internal string vector to a string with the default getString() or operator>>. | |
See MultiField for documentation of inherited functionality.
Definition at line 30 of file mlStringLineMultiField.h.
| ml::StringLineMultiField::StringLineMultiField | ( | const std::string & | name = "" |
) |
Constructor. See constructor of MultiField for documentation.
| std::string ml::StringLineMultiField::getStringValue | ( | const std::string & | sep | ) | const |
Returns a string containing the concatenation of all values from the internal vector separated by the StringLineMultiField::DefaultLineSeparator.
After the last element sep is not appended. Note that using other values than StringLineMultiField::DefaultLineSeparator for sep will cause asymmetric conversion from/to setString(value) and getString() methods. So take care and make use of removeChar('
') and removeChar('') if necessary.
| std::string ml::StringLineMultiField::getStringValue | ( | ) | const [virtual] |
Same as getStringValue(StringLineMultiField::DefaultLineSeparator).
Reimplemented from ml::MultiField< std::string >.
| ml::StringLineMultiField::ML_CLASS_HEADER | ( | StringLineMultiField | ) |
Macro to implement the interface for the Runtime Type System and for the initialization of this class.
See mlRuntimeSubClass.h for more information.
| void ml::StringLineMultiField::removeElements | ( | const std::string & | str = std::string() |
) |
Removes all entries equal to str; default is an empty string to remove all empty entries.
| void ml::StringLineMultiField::removeSubString | ( | const std::string & | str | ) |
Removes the character sequence str from each string element of the internal vector.
| void ml::StringLineMultiField::setStringValue | ( | const std::string & | value, | |
| const std::string & | sep | |||
| ) |
Subdivides value at all positions of sep and stores all values in the internal vector.
Note that '
' characters in value if sep differs from DefaultLineSeparator will not be not used as separator. This will cause asymmetric behaviour from/to the default setString(value) and getString() methods when those are used for field persistence. So take care when using non line feed characters and make use of removeSubString("\n") and/or removeSubString("\r") if necessary.
| value | The string to be subdivided. | |
| sep | The character sequence used to separate string segments. |
| void ml::StringLineMultiField::setStringValue | ( | const std::string & | value | ) | [virtual] |
Same as setStringValue(const std::string &value, char sep) using the "\n" as value for sep; additional carriage return '' characters will silently be removed from the strings.
Reimplemented from ml::MultiField< std::string >.
const std::string ml::StringLineMultiField::DefaultLineSeparator [static] |
The default line separator used for line endings when converting the internal string vector to a string with the default getString() or operator>>.
"\r\n" on windows and "\n" on non windows systems.
Definition at line 37 of file mlStringLineMultiField.h.
1.5.8