FastNBT: Added cFastNBTTag::GetName()
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1437 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
7741de1dbf
commit
bdc06b6e74
@ -505,6 +505,7 @@ void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, si
|
|||||||
Int32 len = htonl(a_NumElements);
|
Int32 len = htonl(a_NumElements);
|
||||||
m_Result.append((const char *)&len, 4);
|
m_Result.append((const char *)&len, 4);
|
||||||
#if defined(ANDROID_NDK)
|
#if defined(ANDROID_NDK)
|
||||||
|
// Android has alignment issues - cannot byteswap (htonl) an int that is not 32-bit-aligned, which happens in the regular version
|
||||||
for (size_t i = 0; i < a_NumElements; i++)
|
for (size_t i = 0; i < a_NumElements; i++)
|
||||||
{
|
{
|
||||||
int Element = htonl(a_Value[i]);
|
int Element = htonl(a_Value[i]);
|
||||||
|
@ -190,6 +190,13 @@ public:
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline AString GetName(int a_Tag) const
|
||||||
|
{
|
||||||
|
AString res;
|
||||||
|
res.assign(m_Data + m_Tags[a_Tag].m_NameStart, m_Tags[a_Tag].m_NameLength);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const char * m_Data;
|
const char * m_Data;
|
||||||
int m_Length;
|
int m_Length;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user