OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
ESM::VariantDataBase Class Referenceabstract

#include <variantimp.hpp>

Inheritance diagram for ESM::VariantDataBase:
Collaboration diagram for ESM::VariantDataBase:

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. More...
 
virtual void write (ESMWriter &esm, Variant::Format format, VarType type) const =0
 If type is not supported by format, an exception is thrown. More...
 
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. More...
 

Constructor & Destructor Documentation

ESM::VariantDataBase::~VariantDataBase ( )
virtual

Member Function Documentation

virtual VariantDataBase* ESM::VariantDataBase::clone ( ) const
pure virtual

Implemented in ESM::VariantFloatData, ESM::VariantIntegerData, and ESM::VariantStringData.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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: