All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
openfluid::core::StringValue Class Reference

#include <core/StringValue.hpp>

Inheritance diagram for openfluid::core::StringValue:
openfluid::core::SimpleValue openfluid::core::Value

Public Member Functions

 StringValue ()
 
 StringValue (const StringValue &Val)
 
 StringValue (const std::string &POD)
 
Valueoperator= (const Value &Other)
 
 operator std::string () const
 
virtual ~StringValue ()
 
Type getType () const
 
Valueclone () const
 
std::string & get ()
 
const std::string & get () const
 
void set (const std::string &Val)
 
void writeToStream (std::ostream &OutStm) const
 
unsigned long getSize () const
 
unsigned long size () const
 
bool toDouble (double &Val) const
 
bool toDoubleValue (DoubleValue &Val) const
 
bool toBoolean (bool &Val) const
 
bool toBooleanValue (BooleanValue &Val) const
 
bool toInteger (long &Val) const
 
bool toIntegerValue (IntegerValue &Val) const
 
bool toNullValue (NullValue &Val) const
 
bool toVectorValue (const std::string &Sep, VectorValue &Val) const
 
bool toMatrixValue (const std::string &ColSep, const std::string &RowSep, MatrixValue &Val) const
 
bool toMatrixValue (const std::string &Sep, const unsigned int &RowLength, MatrixValue &Val) const
 
bool toMapValue (const std::string &Sep, MapValue &Val) const
 
- Public Member Functions inherited from openfluid::core::SimpleValue
bool isSimple () const
 
bool isCompound () const
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()
 
 Value (const Value &)
 
virtual ~Value ()
 
bool isDoubleValue () const
 
const DoubleValueasDoubleValue () const
 
DoubleValueasDoubleValue ()
 
bool isIntegerValue () const
 
const IntegerValueasIntegerValue () const
 
IntegerValueasIntegerValue ()
 
bool isBooleanValue () const
 
const BooleanValueasBooleanValue () const
 
BooleanValueasBooleanValue ()
 
bool isStringValue () const
 
const StringValueasStringValue () const
 
StringValueasStringValue ()
 
bool isNullValue () const
 
const NullValueasNullValue () const
 
NullValueasNullValue ()
 
bool isVectorValue () const
 
const VectorValueasVectorValue () const
 
VectorValueasVectorValue ()
 
bool isMatrixValue () const
 
const MatrixValueasMatrixValue () const
 
MatrixValueasMatrixValue ()
 
bool isMapValue () const
 
const MapValueasMapValue () const
 
MapValueasMapValue ()
 
std::string toString () const
 

Additional Inherited Members

- Public Types inherited from openfluid::core::Value
enum  Type {
  NONE, BOOLEAN, INTEGER, DOUBLE,
  STRING, VECTOR, MATRIX, MAP,
  NULLL
}
 
- Static Public Member Functions inherited from openfluid::core::Value
static bool getValueTypeFromString (const std::string ValueTypeString, Value::Type &ValueType)
 
static std::string getStringFromValueType (const Value::Type ValueType)
 

Detailed Description

StringValue is a container for a std::string value, with methods for conversion to other containers derived from Value.

See Also
Value


Example : declaration

// declaration of a StringValue, initialized to an empty string by default
// declaration of a StringValue, initialized to "hello world"
openfluid::core::StringValue Val2("hello world");

Example : getting the contained value

std::string Tmp1;
// using the get method
Tmp1 = Val1.get();
// or using the cast operator
Tmp1 = Val1;

Example : setting the contained value

// using the set method
Val1.set("Have a nice day");

Constructor & Destructor Documentation

openfluid::core::StringValue::StringValue ( )
inline

Default constructor

openfluid::core::StringValue::StringValue ( const StringValue Val)
inline

Copy constructor

openfluid::core::StringValue::StringValue ( const std::string &  POD)
inline

Constructor from plain old type

virtual openfluid::core::StringValue::~StringValue ( )
inlinevirtual

Member Function Documentation

Value* openfluid::core::StringValue::clone ( ) const
inlinevirtual

Reimplemented from openfluid::core::Value.

std::string& openfluid::core::StringValue::get ( )
inline

Returns the string value as plain old type

Returns
the string value
const std::string& openfluid::core::StringValue::get ( ) const
inline

Returns the string value as a const plain old type

Returns
the string value
unsigned long openfluid::core::StringValue::getSize ( ) const
inline

Returns the size of the string

Returns
size of the string
Type openfluid::core::StringValue::getType ( ) const
inlinevirtual
openfluid::core::StringValue::operator std::string ( ) const
inline

Cast operator

Value& openfluid::core::StringValue::operator= ( const Value )
virtual

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::StringValue::set ( const std::string &  Val)
inline

Sets the string value

Parameters
[in]Valthe string value
unsigned long openfluid::core::StringValue::size ( ) const
inline

Returns the size of the string

Returns
size of the string
bool openfluid::core::StringValue::toBoolean ( bool &  Val) const

Converts the contained string to a boolean value (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toBooleanValue ( BooleanValue Val) const

Converts the contained string to a BooleanValue (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
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
bool openfluid::core::StringValue::toDoubleValue ( DoubleValue Val) const

Converts the contained string to a DoubleValue (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toInteger ( long &  Val) const

Converts the contained string to a long value (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toIntegerValue ( IntegerValue Val) const

Converts the contained string to an IntegerValue (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toMapValue ( const std::string &  Sep,
MapValue Val 
) const

Converts the contained string to a MapValue value (if possible)

Parameters
[in]Septhe separator used to split the string into map items
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toMatrixValue ( const std::string &  ColSep,
const std::string &  RowSep,
MatrixValue Val 
) const

Converts the contained string to a MatrixValue value (if possible)

Parameters
[in]ColSepthe column separator used to split the string columns
[in]RowSepthe row separator used to split the string rows
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toMatrixValue ( const std::string &  Sep,
const unsigned int &  RowLength,
MatrixValue Val 
) const

Converts the contained string to a MatrixValue value (if possible)

Parameters
[in]Septhe separator used to split the string
[in]RowLengththe size of a row
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toNullValue ( NullValue Val) const

Converts the contained string to a NullValue (if possible)

Parameters
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
bool openfluid::core::StringValue::toVectorValue ( const std::string &  Sep,
VectorValue Val 
) const

Converts the contained string to a VectorValue value (if possible)

Parameters
[in]Septhe separator used to split the string into vector items
[out]Valthe converted value
Returns
bool true if the conversion is correct, false otherwise
void openfluid::core::StringValue::writeToStream ( std::ostream &  OutStm) const
virtual

The documentation for this class was generated from the following file: