#include <parser.h>
Collaboration diagram for Value:

Public Types | |
| enum | ValueType { NumberType = 0, StringType = 1, ArrayType = 2, HashType = 3, BooleanType = 4 } |
Public Member Functions | |
| Array * | getArray () const |
| bool | getBoolean () const |
| Hash * | getHash () const |
| double | getNumber () const |
| string | getString () const |
| ValueType | getType () const |
| Value (bool) | |
| Value (Hash *) | |
| Value (Array *) | |
| Value (string) | |
| Value (double) | |
| ~Value () | |
Private Attributes | |
| union { | |
| Array * a | |
| double d | |
| Hash * h | |
| string * s | |
| } | data |
| ValueType | type |
|
|
Definition at line 51 of file parser.h. 00051 {
00052 NumberType = 0,
00053 StringType = 1,
00054 ArrayType = 2,
00055 HashType = 3,
00056 BooleanType = 4
00057 };
|
|
|
Definition at line 15 of file parser.cpp. References data, NumberType, and type. 00016 {
00017 type = NumberType;
00018 data.d = d;
00019 }
|
|
|
Definition at line 21 of file parser.cpp. References data, StringType, and type. 00022 {
00023 type = StringType;
00024 data.s = new string(s);
00025 }
|
|
|
Definition at line 27 of file parser.cpp. References a, ArrayType, data, and type.
|
|
|
Definition at line 33 of file parser.cpp. References data, h, HashType, and type.
|
|
|
Definition at line 39 of file parser.cpp. References BooleanType, data, and type. 00040 {
00041 type = BooleanType;
00042 data.d = b ? 1.0 : 0.0;
00043 }
|
|
|
Definition at line 45 of file parser.cpp. References ArrayType, data, HashType, StringType, and type. 00046 {
00047 if (type == StringType)
00048 {
00049 delete data.s;
00050 }
00051 else if (type == ArrayType)
00052 {
00053 if (data.a != NULL)
00054 {
00055 for (unsigned int i = 0; i < data.a->size(); i++)
00056 delete (*data.a)[i];
00057 delete data.a;
00058 }
00059 }
00060 else if (type == HashType)
00061 {
00062 if (data.h != NULL)
00063 {
00064 #if 0
00065 Hash::iterator iter = data.h->begin();
00066 while (iter != data.h->end())
00067 {
00068 delete iter->second;
00069 iter++;
00070 }
00071 #endif
00072 delete data.h;
00073 }
00074 }
00075 }
|
|
|
Definition at line 94 of file parser.cpp. References data. Referenced by AssociativeArray::getRotation(), AssociativeArray::getVector(), ReadAsterismList(), and ReadCelestiaConfig(). 00095 {
00096 // ASSERT(type == ArrayType);
00097 return data.a;
00098 }
|
|
|
Definition at line 106 of file parser.cpp. References data. Referenced by AssociativeArray::getBoolean(). 00107 {
00108 // ASSERT(type == BooleanType);
00109 return (data.d != 0.0);
00110 }
|
|
|
Definition at line 100 of file parser.cpp. References data. Referenced by CreateOrbit(), CreatePlanet(), StarDatabase::load(), DSODatabase::load(), LoadCelestiaMesh(), LoadSolarSystemObjects(), LoadVirtualTexture(), CommandParser::parseCommand(), ReadCelestiaConfig(), ReadDestinationList(), and ReadFavoritesList(). 00101 {
00102 // ASSERT(type == HashType);
00103 return data.h;
00104 }
|
|
|
Definition at line 82 of file parser.cpp. References data. Referenced by AssociativeArray::getNumber(), AssociativeArray::getRotation(), and AssociativeArray::getVector(). 00083 {
00084 // ASSERT(type == NumberType);
00085 return data.d;
00086 }
|
|
|
Definition at line 88 of file parser.cpp. References data. Referenced by AssociativeArray::getString(), and ReadCelestiaConfig(). 00089 {
00090 // ASSERT(type == StringType);
00091 return *data.s;
00092 }
|
|
|
Definition at line 77 of file parser.cpp. References type. Referenced by CreateOrbit(), CreatePlanet(), AssociativeArray::getBoolean(), AssociativeArray::getNumber(), AssociativeArray::getRotation(), AssociativeArray::getString(), AssociativeArray::getVector(), StarDatabase::load(), DSODatabase::load(), LoadCelestiaMesh(), LoadSolarSystemObjects(), LoadVirtualTexture(), CommandParser::parseCommand(), ReadAsterismList(), ReadCelestiaConfig(), ReadDestinationList(), and ReadFavoritesList(). 00078 {
00079 return type;
00080 }
|
|
|
Definition at line 80 of file parser.h. Referenced by Value(). |
|
|
|
|
|
Referenced by getArray(), getBoolean(), getHash(), getNumber(), getString(), Value(), and ~Value(). |
|
|
Definition at line 81 of file parser.h. Referenced by Value(). |
|
|
|
|
|
|
1.4.1