#include <core/StringValue.hpp>
|
enum | Type {
NONE,
BOOLEAN,
INTEGER,
DOUBLE,
STRING,
VECTOR,
MATRIX,
MAP,
TREE,
NULLL
} |
|
static bool | getValueTypeFromString (const std::string &ValueTypeString, Value::Type &ValueType) |
|
static std::string | getStringFromValueType (const Value::Type ValueType) |
|
StringValue is a container for a std::string value, with methods for conversion to other containers derived from Value.
- See also
- Value
Example : declaration
Example : getting the contained value
std::string Tmp1;
Tmp1 = Val1;
Example : setting the contained value
Val1.
set(
"Have a nice day");
◆ StringValue() [1/7]
openfluid::core::StringValue::StringValue |
( |
| ) |
|
|
inline |
◆ StringValue() [2/7]
openfluid::core::StringValue::StringValue |
( |
const StringValue & |
Val | ) |
|
|
inline |
◆ StringValue() [3/7]
openfluid::core::StringValue::StringValue |
( |
const char * |
Val | ) |
|
|
inline |
◆ StringValue() [4/7]
openfluid::core::StringValue::StringValue |
( |
const std::string & |
Val | ) |
|
|
inline |
Constructor from std::string
◆ StringValue() [5/7]
openfluid::core::StringValue::StringValue |
( |
bool |
Val | ) |
|
◆ StringValue() [6/7]
openfluid::core::StringValue::StringValue |
( |
int |
Val | ) |
|
◆ StringValue() [7/7]
openfluid::core::StringValue::StringValue |
( |
double |
Val | ) |
|
◆ ~StringValue()
virtual openfluid::core::StringValue::~StringValue |
( |
| ) |
|
|
inlinevirtual |
◆ clear()
void openfluid::core::StringValue::clear |
( |
| ) |
|
|
inline |
◆ clone()
Value* openfluid::core::StringValue::clone |
( |
| ) |
const |
|
inlinevirtual |
◆ convert()
bool openfluid::core::StringValue::convert |
( |
Value & |
Val | ) |
const |
|
virtual |
◆ data() [1/2]
std::string& openfluid::core::StringValue::data |
( |
| ) |
|
|
inline |
Returns a reference to the string value as std::string type
- Returns
- the string value
◆ data() [2/2]
const std::string& openfluid::core::StringValue::data |
( |
| ) |
const |
|
inline |
Returns a reference to the string value as std::string type
- Returns
- the string value
◆ get()
std::string openfluid::core::StringValue::get |
( |
| ) |
const |
|
inline |
Returns the string value as std::string type
- Returns
- the string value
◆ getSize()
unsigned long openfluid::core::StringValue::getSize |
( |
| ) |
const |
|
inline |
Returns the size of the string
- Returns
- size of the string
◆ getType()
Type openfluid::core::StringValue::getType |
( |
| ) |
const |
|
inlinevirtual |
◆ guessTypeConversion()
Value::Type openfluid::core::StringValue::guessTypeConversion |
( |
| ) |
const |
Try to find the the most adapted type for conversion
- Returns
- the most adapted type for conversion (if the value is empty)
◆ operator std::string()
openfluid::core::StringValue::operator std::string |
( |
| ) |
const |
|
inline |
◆ operator=()
Value& openfluid::core::StringValue::operator= |
( |
const Value & |
Other | ) |
|
|
virtual |
◆ replaceAll()
unsigned int openfluid::core::StringValue::replaceAll |
( |
const std::string & |
FindStr, |
|
|
const std::string & |
ReplaceStr |
|
) |
| |
Replaces all occurences of FindStr by ReplaceStr
- Parameters
-
[in] | FindStr | the substring to find |
[in] | ReplaceStr | the substring to replace the found substrings |
- Returns
- the number of occurences
◆ set()
void openfluid::core::StringValue::set |
( |
const std::string & |
Val | ) |
|
|
inline |
Sets the string value
- Parameters
-
◆ size()
unsigned long openfluid::core::StringValue::size |
( |
| ) |
const |
|
inline |
Returns the size of the string
- Returns
- size of the string
◆ toBoolean()
bool openfluid::core::StringValue::toBoolean |
( |
bool & |
Val | ) |
const |
Converts the contained string to a boolean value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toBooleanValue()
bool openfluid::core::StringValue::toBooleanValue |
( |
BooleanValue & |
Val | ) |
const |
Converts the contained string to a BooleanValue (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toDouble()
bool openfluid::core::StringValue::toDouble |
( |
double & |
Val | ) |
const |
Converts the contained string to a double value (if possible)
- Returns
- bool true if the conversion is correct, false otherwise
◆ toDoubleValue()
bool openfluid::core::StringValue::toDoubleValue |
( |
DoubleValue & |
Val | ) |
const |
Converts the contained string to a DoubleValue (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toInteger() [1/2]
bool openfluid::core::StringValue::toInteger |
( |
int & |
Val | ) |
const |
Converts the contained string to an int value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toInteger() [2/2]
bool openfluid::core::StringValue::toInteger |
( |
long & |
Val | ) |
const |
Converts the contained string to a long value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toIntegerValue()
bool openfluid::core::StringValue::toIntegerValue |
( |
IntegerValue & |
Val | ) |
const |
Converts the contained string to an IntegerValue (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toMapValue()
bool openfluid::core::StringValue::toMapValue |
( |
MapValue & |
Val | ) |
const |
Converts the contained string to a MapValue value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toMatrixValue() [1/2]
bool openfluid::core::StringValue::toMatrixValue |
( |
MatrixValue & |
Val | ) |
const |
Converts the contained string to a MatrixValue value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toMatrixValue() [2/2]
bool openfluid::core::StringValue::toMatrixValue |
( |
const unsigned int & |
RowLength, |
|
|
MatrixValue & |
Val |
|
) |
| const |
Converts the contained string to a MatrixValue value (if possible)
- Parameters
-
[in] | RowLength | the size of a row |
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toNullValue()
bool openfluid::core::StringValue::toNullValue |
( |
NullValue & |
Val | ) |
const |
Converts the contained string to a NullValue (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ toTreeValue()
bool openfluid::core::StringValue::toTreeValue |
( |
TreeValue & |
Val | ) |
const |
Converts the contained string to a TreeValue value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
- Exceptions
-
FrameworkException | when called |
- Warning
- This method is currently not implement and always throws a FrameworkException
◆ toVectorValue()
bool openfluid::core::StringValue::toVectorValue |
( |
VectorValue & |
Val | ) |
const |
Converts the contained string to a VectorValue value (if possible)
- Parameters
-
[out] | Val | the converted value |
- Returns
- bool true if the conversion is correct, false otherwise
◆ writeQuotedToStream()
void openfluid::core::StringValue::writeQuotedToStream |
( |
std::ostream & |
OutStm | ) |
const |
|
inlinevirtual |
◆ writeToStream()
void openfluid::core::StringValue::writeToStream |
( |
std::ostream & |
OutStm | ) |
const |
|
virtual |
The documentation for this class was generated from the following file: