OpenMW
Public Member Functions
ESM::VariantDataBase Class Reference

#include <variantimp.hpp>

List of all members.

Public Member Functions

virtual ~VariantDataBase ()
virtual VariantDataBaseclone () 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.

Constructor & Destructor Documentation


Member Function Documentation

virtual VariantDataBase* ESM::VariantDataBase::clone ( ) const [pure virtual]
float ESM::VariantDataBase::getFloat ( bool  default_ = false) const [virtual]

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

Parameters:
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).

Parameters:
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.

Note:
Numeric values are not converted to strings.
Parameters:
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.


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