OpenMW
|
#include <variantimp.hpp>
Public Member Functions | |
virtual | ~VariantDataBase () |
virtual VariantDataBase * | clone () const =0 |
virtual std::string | getString (bool default_=false) const |
virtual int | getInteger (bool default_=false) const |
virtual float | getFloat (bool default_=false) const |
virtual void | setString (const std::string &value) |
virtual void | setInteger (int value) |
virtual void | setFloat (float value) |
virtual void | read (ESMReader &esm, Variant::Format format, VarType type)=0 |
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 =0 |
If type is not supported by format, an exception is thrown. | |
virtual bool | isEqual (const VariantDataBase &value) const =0 |
If the (C++) type of value does not match the type of *this, an exception is thrown. |
ESM::VariantDataBase::~VariantDataBase | ( | ) | [virtual] |
virtual VariantDataBase* ESM::VariantDataBase::clone | ( | ) | const [pure virtual] |
Implemented in ESM::VariantFloatData, ESM::VariantIntegerData, and ESM::VariantStringData.
float ESM::VariantDataBase::getFloat | ( | bool | default_ = false | ) | const [virtual] |
Will throw an exception, if value can not be represented as a float value.
default_ | Return a default value instead of throwing an exception. |
Default-implementation: throw an exception.
Reimplemented in ESM::VariantFloatData, and ESM::VariantIntegerData.
int ESM::VariantDataBase::getInteger | ( | bool | default_ = false | ) | const [virtual] |
Will throw an exception, if value can not be represented as an integer (implicit casting of float values is permitted).
default_ | Return a default value instead of throwing an exception. |
Default-implementation: throw an exception.
Reimplemented in ESM::VariantFloatData, and ESM::VariantIntegerData.
std::string ESM::VariantDataBase::getString | ( | bool | default_ = false | ) | const [virtual] |
Will throw an exception, if value can not be represented as a string.
default_ | Return a default value instead of throwing an exception. |
Default-implementation: throw an exception.
Reimplemented in ESM::VariantStringData.
virtual bool ESM::VariantDataBase::isEqual | ( | const VariantDataBase & | value | ) | const [pure virtual] |
If the (C++) type of value does not match the type of *this, an exception is thrown.
Implemented in ESM::VariantFloatData, ESM::VariantIntegerData, and ESM::VariantStringData.
virtual void ESM::VariantDataBase::read | ( | ESMReader & | esm, |
Variant::Format | format, | ||
VarType | type | ||
) | [pure virtual] |
If type is not supported by format, an exception is thrown via ESMReader::fail.
Implemented in ESM::VariantFloatData, ESM::VariantIntegerData, and ESM::VariantStringData.
void ESM::VariantDataBase::setFloat | ( | float | value | ) | [virtual] |
Will throw an exception, if type is not compatible with float.
Default-implementation: throw an exception.
Reimplemented in ESM::VariantFloatData, and ESM::VariantIntegerData.
void ESM::VariantDataBase::setInteger | ( | int | value | ) | [virtual] |
Will throw an exception, if type is not compatible with integer.
Default-implementation: throw an exception.
Reimplemented in ESM::VariantFloatData, and ESM::VariantIntegerData.
void ESM::VariantDataBase::setString | ( | const std::string & | value | ) | [virtual] |
Will throw an exception, if type is not compatible with string.
Default-implementation: throw an exception.
Reimplemented in ESM::VariantStringData.
virtual void ESM::VariantDataBase::write | ( | ESMWriter & | esm, |
Variant::Format | format, | ||
VarType | type | ||
) | const [pure virtual] |
If type is not supported by format, an exception is thrown.
Implemented in ESM::VariantFloatData, ESM::VariantIntegerData, and ESM::VariantStringData.