OpenMW
Public Types | Public Member Functions | Private Attributes
ESM::Variant Class Reference

#include <variant.hpp>

List of all members.

Public Types

enum  Format { Format_Global, Format_Gmst, Format_Info }

Public Member Functions

 Variant ()
 ~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.
int getInteger () const
float getFloat () const
 Will throw an exception, if value can not be represented as a float value.
void read (ESMReader &esm, Format format)
void write (ESMWriter &esm, Format format) const
void write (std::ostream &stream) const
 Write in text format.
void setType (VarType type)
void setString (const std::string &value)
 Will throw an exception, if type is not compatible with string.
void setInteger (int value)
 Will throw an exception, if type is not compatible with integer.
void setFloat (float value)
 Will throw an exception, if type is not compatible with float.
bool isEqual (const Variant &value) const

Private Attributes

VarType mType
VariantDataBasemData

Member Enumeration Documentation

Enumerator:
Format_Global 
Format_Gmst 
Format_Info 

Constructor & Destructor Documentation

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.

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

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

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

bool ESM::Variant::isEqual ( const Variant value) const
ESM::Variant & ESM::Variant::operator= ( const Variant variant)
void ESM::Variant::read ( ESMReader esm,
Format  format 
)
void ESM::Variant::setFloat ( float  value)

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

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

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

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

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

void ESM::Variant::write ( ESMWriter esm,
Format  format 
) const
void ESM::Variant::write ( std::ostream &  stream) const

Write in text format.


Member Data Documentation


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