OpenMW
Public Member Functions | Private Attributes
ESM::VariantStringData Class Reference

#include <variantimp.hpp>

List of all members.

Public Member Functions

 VariantStringData (const VariantDataBase *data=0)
virtual VariantDataBaseclone () const
virtual std::string getString (bool default_=false) const
virtual void setString (const std::string &value)
 Will throw an exception, if type is not compatible with string.
virtual void read (ESMReader &esm, Variant::Format format, VarType type)
 If type is not supported by format, an exception is thrown via ESMReader::fail.
virtual void write (ESMWriter &esm, Variant::Format format, VarType type) const
 If type is not supported by format, an exception is thrown.
virtual bool isEqual (const VariantDataBase &value) const
 If the (C++) type of value does not match the type of *this, an exception is thrown.

Private Attributes

std::string mValue

Constructor & Destructor Documentation

Calling the constructor with an incompatible data type will result in a silent default initialisation.


Member Function Documentation

Implements ESM::VariantDataBase.

std::string ESM::VariantStringData::getString ( bool  default_ = false) const [virtual]

Will throw an exception, if value can not be represented as a string.

Note:
Numeric values are not converted to strings.
Parameters:
default_Return a default value instead of throwing an exception.

Reimplemented from ESM::VariantDataBase.

bool ESM::VariantStringData::isEqual ( const VariantDataBase value) const [virtual]

If the (C++) type of value does not match the type of *this, an exception is thrown.

Implements ESM::VariantDataBase.

void ESM::VariantStringData::read ( ESMReader esm,
Variant::Format  format,
VarType  type 
) [virtual]

If type is not supported by format, an exception is thrown via ESMReader::fail.

Implements ESM::VariantDataBase.

void ESM::VariantStringData::setString ( const std::string &  value) [virtual]

Will throw an exception, if type is not compatible with string.

Reimplemented from ESM::VariantDataBase.

void ESM::VariantStringData::write ( ESMWriter esm,
Variant::Format  format,
VarType  type 
) const [virtual]

If type is not supported by format, an exception is thrown.

Implements ESM::VariantDataBase.


Member Data Documentation

std::string ESM::VariantStringData::mValue [private]

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