OpenMW
|
#include <variant.hpp>
Public Types | |
enum | Format { Format_Global, Format_Gmst, Format_Info } |
Public Member Functions | |
Variant () | |
~Variant () | |
Variant & | operator= (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 |
VariantDataBase * | mData |
enum ESM::Variant::Format |
ESM::Variant::Variant | ( | const Variant & | variant | ) |
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.
ESM::VarType ESM::Variant::getType | ( | ) | const |
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::setType | ( | VarType | type | ) |
void ESM::Variant::write | ( | ESMWriter & | esm, |
Format | format | ||
) | const |
void ESM::Variant::write | ( | std::ostream & | stream | ) | const |
Write in text format.
VariantDataBase* ESM::Variant::mData [private] |
VarType ESM::Variant::mType [private] |