summaryrefslogtreecommitdiffstats
path: root/converter/cNBTData.h
diff options
context:
space:
mode:
Diffstat (limited to 'converter/cNBTData.h')
-rw-r--r--converter/cNBTData.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/converter/cNBTData.h b/converter/cNBTData.h
index 4d5ec0beb..d3e5e82b6 100644
--- a/converter/cNBTData.h
+++ b/converter/cNBTData.h
@@ -38,7 +38,9 @@ public:
void PutByte( std::string Name, char Value ) { m_Bytes[Name] = Value; }
void PutShort( std::string Name, short Value ) { m_Shorts[Name] = Value; }
void PutInteger( std::string Name, int Value ) { m_Integers[Name] = Value; }
- void PutLong( std::string Name, long Value ) { m_Longs[Name] = Value; }
+ void PutLong( std::string Name, long long Value ) { m_Longs[Name] = Value; }
+ void PutDouble( std::string Name, double Value ) { m_Doubles[Name] = Value; }
+ void PutFloat( std::string Name, float Value ) { m_Floats[Name] = Value; }
void PutString( std::string Name, std::string Value ) { m_Strings[Name] = Value; }
void PutByteArray( std::string Name, char* ByteArray ) { m_ByteArrays[Name] = ByteArray; }
void PutCompound( std::string Name );
@@ -47,7 +49,9 @@ public:
char GetByte( std::string Name ) { return m_Bytes[Name]; }
short GetShort( std::string Name ) { return m_Shorts[Name]; }
int GetInteger( std::string Name ) { return m_Integers[Name]; }
- long GetLong( std::string Name ) { return m_Longs[Name]; }
+ long long GetLong( std::string Name ) { return m_Longs[Name]; }
+ double GetDouble( std::string Name ) { return m_Doubles[Name]; }
+ float GetFloat( std::string Name ) { return m_Floats[Name]; }
std::string GetString( std::string Name ) { return m_Strings[Name]; }
char* GetByteArray( std::string Name ) { return m_ByteArrays[Name]; }
cNBTCompound* GetCompound( std::string Name );
@@ -72,7 +76,9 @@ private:
typedef std::map<std::string, char> ByteMap;
typedef std::map<std::string, short> ShortMap;
typedef std::map<std::string, int> IntegerMap;
- typedef std::map<std::string, long> LongMap;
+ typedef std::map<std::string, long long> LongMap;
+ typedef std::map<std::string, double> DoubleMap;
+ typedef std::map<std::string, float> FloatMap;
typedef std::map<std::string, std::string> StringMap;
typedef std::map<std::string, char*> ByteArrayMap;
typedef std::map<std::string, cNBTCompound*> CompoundMap;
@@ -81,6 +87,8 @@ private:
ShortMap m_Shorts;
IntegerMap m_Integers;
LongMap m_Longs;
+ DoubleMap m_Doubles;
+ FloatMap m_Floats;
StringMap m_Strings;
ByteArrayMap m_ByteArrays;
CompoundMap m_Compounds;
@@ -131,14 +139,18 @@ public:
void PutByte( std::string Name, char Value ) { m_CurrentCompound->PutByte( Name, Value ); }
void PutShort( std::string Name, short Value ) { m_CurrentCompound->PutShort( Name, Value ); }
void PutInteger( std::string Name, int Value ) { m_CurrentCompound->PutInteger( Name, Value ); }
- void PutLong( std::string Name, long Value ) { m_CurrentCompound->PutLong( Name, Value ); }
- void PutString( std::string Name, std::string Value ) { m_CurrentCompound->PutString(Name, Value); }
+ void PutLong( std::string Name, long long Value ) { m_CurrentCompound->PutLong( Name, Value ); }
+ void PutDouble( std::string Name, double Value ) { m_CurrentCompound->PutDouble( Name, Value ); }
+ void PutFloat( std::string Name, float Value ) { m_CurrentCompound->PutFloat( Name, Value ); }
+ void PutString( std::string Name, std::string Value ) { m_CurrentCompound->PutString( Name, Value ); }
void PutByteArray( std::string Name, char* ByteArray ) { m_CurrentCompound->PutByteArray( Name, ByteArray ); }
void PutCompound( std::string Name ) { m_CurrentCompound->PutCompound( Name ); }
void PutList( std::string Name, ENUM_TAG Type ) { m_CurrentCompound->PutList( Name, Type ); }
int GetInteger( std::string Name ) { return m_CurrentCompound->GetInteger(Name); }
- long GetLong( std::string Name ) { return m_CurrentCompound->GetLong(Name); }
+ long long GetLong( std::string Name ) { return m_CurrentCompound->GetLong(Name); }
+ double GetDouble( std::string Name ) { return m_CurrentCompound->GetDouble(Name); }
+ float GetFloat( std::string Name ) { return m_CurrentCompound->GetFloat(Name); }
std::string GetString( std::string Name ) { return m_CurrentCompound->GetString(Name); }
char* GetByteArray( std::string Name ) { return m_CurrentCompound->GetByteArray(Name); }
cNBTCompound* GetCompound( std::string Name ) { return m_CurrentCompound->GetCompound(Name); }
@@ -163,6 +175,8 @@ private:
void ParseByteArray( bool a_bNamed );
void ParseInt( bool a_bNamed );
void ParseLong( bool a_bNamed );
+ void ParseDouble( bool a_bNamed );
+ void ParseFloat( bool a_bNamed );
void ParseShort( bool a_bNamed );
short ReadShort();
@@ -170,12 +184,15 @@ private:
char ReadByte();
int ReadInt();
long long ReadLong();
+ double ReadDouble();
+ float ReadFloat();
cNBTCompound* m_CurrentCompound;
char* m_Buffer;
unsigned int m_BufferSize;
unsigned int m_Index;
+ bool tm;
void (cNBTData::*m_ParseFunctions[TAG_NumTags])(bool);
};