OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
ESM::Variant Class Reference

#include <variant.hpp>

Collaboration diagram for ESM::Variant:

Public Types

enum  Format { Format_Global, Format_Gmst, Format_Info, Format_Local }
 

Public Member Functions

 Variant ()
 
 Variant (const std::string &value)
 
 Variant (int value)
 
 Variant (float value)
 
 ~Variant ()
 
Variantoperator= (const Variant &variant)
 
 Variant (const Variant &variant)
 
VarType getType () const
 
std::string getString () const
 Will throw an exception, if value can not be represented as a string. More...
 
int getInteger () const
 
float getFloat () const
 Will throw an exception, if value can not be represented as a float value. More...
 
void read (ESMReader &esm, Format format)
 
void write (ESMWriter &esm, Format format) const
 
void write (std::ostream &stream) const
 Write in text format. More...
 
void setType (VarType type)
 
void setString (const std::string &value)
 Will throw an exception, if type is not compatible with string. More...
 
void setInteger (int value)
 Will throw an exception, if type is not compatible with integer. More...
 
void setFloat (float value)
 Will throw an exception, if type is not compatible with float. More...
 
bool isEqual (const Variant &value) const
 

Private Attributes

VarType mType
 
VariantDataBasemData
 

Member Enumeration Documentation

Enumerator
Format_Global 
Format_Gmst 
Format_Info 
Format_Local 

Constructor & Destructor Documentation

ESM::Variant::Variant ( )
ESM::Variant::Variant ( const std::string &  value)
ESM::Variant::Variant ( int  value)
ESM::Variant::Variant ( float  value)
ESM::Variant::~Variant ( )
ESM::Variant::Variant ( const Variant variant)

Member Function Documentation

float ESM::Variant::getFloat ( ) const

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

Here is the caller graph for this function:

int ESM::Variant::getInteger ( ) const

Will throw an exception, if value can not be represented as an integer (implicit casting of float values is permitted).

Here is the caller graph for this function:

std::string ESM::Variant::getString ( ) const

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

Here is the caller graph for this function:

ESM::VarType ESM::Variant::getType ( ) const

Here is the caller graph for this function:

bool ESM::Variant::isEqual ( const Variant value) const

Here is the caller graph for this function:

ESM::Variant & ESM::Variant::operator= ( const Variant variant)

Here is the call graph for this function:

void ESM::Variant::read ( ESMReader esm,
Format  format 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void ESM::Variant::setFloat ( float  value)

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

Here is the caller graph for this function:

void ESM::Variant::setInteger ( int  value)

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

Here is the caller graph for this function:

void ESM::Variant::setString ( const std::string &  value)

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

Here is the caller graph for this function:

void ESM::Variant::setType ( VarType  type)

Here is the caller graph for this function:

void ESM::Variant::write ( ESMWriter esm,
Format  format 
) const

Here is the caller graph for this function:

void ESM::Variant::write ( std::ostream &  stream) const

Write in text format.

Member Data Documentation

VariantDataBase* ESM::Variant::mData
private
VarType ESM::Variant::mType
private

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