|
@@ -26,10 +26,10 @@ bool ObjectStreamIn::GetInfo(istream &inStream, EStreamType &outType, int &outVe
|
|
inStream.read(header, 8);
|
|
inStream.read(header, 8);
|
|
if ((header[0] == 'B' || header[0] == 'T') && header[1] == 'O' && header[2] == 'S'
|
|
if ((header[0] == 'B' || header[0] == 'T') && header[1] == 'O' && header[2] == 'S'
|
|
&& (header[3] == ' ' || isdigit(header[3])) && isdigit(header[4])
|
|
&& (header[3] == ' ' || isdigit(header[3])) && isdigit(header[4])
|
|
- && header[5] == '.' && isdigit(header[6]) && isdigit(header[7]))
|
|
|
|
|
|
+ && header[5] == '.' && isdigit(header[6]) && isdigit(header[7]))
|
|
{
|
|
{
|
|
// Check if this is a binary or text objectfile
|
|
// Check if this is a binary or text objectfile
|
|
- switch (header[0])
|
|
|
|
|
|
+ switch (header[0])
|
|
{
|
|
{
|
|
case 'T': outType = ObjectStream::EStreamType::Text; break;
|
|
case 'T': outType = ObjectStream::EStreamType::Text; break;
|
|
case 'B': outType = ObjectStream::EStreamType::Binary; break;
|
|
case 'B': outType = ObjectStream::EStreamType::Binary; break;
|
|
@@ -42,7 +42,7 @@ bool ObjectStreamIn::GetInfo(istream &inStream, EStreamType &outType, int &outVe
|
|
outRevision = atoi(&header[6]);
|
|
outRevision = atoi(&header[6]);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
Trace("ObjectStreamIn: Not a valid object stream.");
|
|
Trace("ObjectStreamIn: Not a valid object stream.");
|
|
return false;
|
|
return false;
|
|
@@ -54,19 +54,19 @@ ObjectStreamIn *ObjectStreamIn::Open(istream &inStream)
|
|
EStreamType type;
|
|
EStreamType type;
|
|
int version;
|
|
int version;
|
|
int revision;
|
|
int revision;
|
|
- if (GetInfo(inStream, type, version, revision))
|
|
|
|
|
|
+ if (GetInfo(inStream, type, version, revision))
|
|
{
|
|
{
|
|
- if (version == sVersion && revision == sRevision)
|
|
|
|
|
|
+ if (version == sVersion && revision == sRevision)
|
|
{
|
|
{
|
|
// Create an input stream of the correct type
|
|
// Create an input stream of the correct type
|
|
- switch (type)
|
|
|
|
|
|
+ switch (type)
|
|
{
|
|
{
|
|
case EStreamType::Text: return new ObjectStreamTextIn(inStream);
|
|
case EStreamType::Text: return new ObjectStreamTextIn(inStream);
|
|
case EStreamType::Binary: return new ObjectStreamBinaryIn(inStream);
|
|
case EStreamType::Binary: return new ObjectStreamBinaryIn(inStream);
|
|
default: JPH_ASSERT(false);
|
|
default: JPH_ASSERT(false);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
Trace("ObjectStreamIn: Different version stream (%d.%02d, expected %d.%02d).", version, revision, sVersion, sRevision);
|
|
Trace("ObjectStreamIn: Different version stream (%d.%02d, expected %d.%02d).", version, revision, sVersion, sRevision);
|
|
}
|
|
}
|
|
@@ -86,13 +86,13 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
{
|
|
{
|
|
// Get type of next operation
|
|
// Get type of next operation
|
|
EOSDataType data_type;
|
|
EOSDataType data_type;
|
|
- if (!ReadDataType(data_type))
|
|
|
|
|
|
+ if (!ReadDataType(data_type))
|
|
break;
|
|
break;
|
|
|
|
|
|
if (data_type == EOSDataType::Declare)
|
|
if (data_type == EOSDataType::Declare)
|
|
- {
|
|
|
|
|
|
+ {
|
|
// Read type declaration
|
|
// Read type declaration
|
|
- if (!ReadRTTI())
|
|
|
|
|
|
+ if (!ReadRTTI())
|
|
{
|
|
{
|
|
Trace("ObjectStreamIn: Fatal error while reading class description for class %s.", inRTTI->GetName());
|
|
Trace("ObjectStreamIn: Fatal error while reading class description for class %s.", inRTTI->GetName());
|
|
continue_reading = false;
|
|
continue_reading = false;
|
|
@@ -100,13 +100,13 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (data_type == EOSDataType::Object)
|
|
else if (data_type == EOSDataType::Object)
|
|
- {
|
|
|
|
|
|
+ {
|
|
const RTTI *rtti;
|
|
const RTTI *rtti;
|
|
void *object = ReadObject(rtti);
|
|
void *object = ReadObject(rtti);
|
|
- if (!main_object && object)
|
|
|
|
|
|
+ if (!main_object && object)
|
|
{
|
|
{
|
|
// This is the first and thus main object of the file.
|
|
// This is the first and thus main object of the file.
|
|
- if (rtti->IsKindOf(inRTTI))
|
|
|
|
|
|
+ if (rtti->IsKindOf(inRTTI))
|
|
{
|
|
{
|
|
// Object is of correct type
|
|
// Object is of correct type
|
|
main_object = object;
|
|
main_object = object;
|
|
@@ -120,7 +120,7 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
- {
|
|
|
|
|
|
+ {
|
|
// Invalid or out of place token found
|
|
// Invalid or out of place token found
|
|
Trace("ObjectStreamIn: Invalid or out of place token found.");
|
|
Trace("ObjectStreamIn: Invalid or out of place token found.");
|
|
continue_reading = false;
|
|
continue_reading = false;
|
|
@@ -129,14 +129,14 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
}
|
|
}
|
|
|
|
|
|
// Resolve links (pointer, references)
|
|
// Resolve links (pointer, references)
|
|
- if (continue_reading)
|
|
|
|
- {
|
|
|
|
|
|
+ if (continue_reading)
|
|
|
|
+ {
|
|
// Resolve links
|
|
// Resolve links
|
|
ObjectSet referenced_objects;
|
|
ObjectSet referenced_objects;
|
|
- for (Link &link : mUnresolvedLinks)
|
|
|
|
|
|
+ for (Link &link : mUnresolvedLinks)
|
|
{
|
|
{
|
|
IdentifierMap::const_iterator j = mIdentifierMap.find(link.mIdentifier);
|
|
IdentifierMap::const_iterator j = mIdentifierMap.find(link.mIdentifier);
|
|
- if (j != mIdentifierMap.end() && j->second.mRTTI->IsKindOf(link.mRTTI))
|
|
|
|
|
|
+ if (j != mIdentifierMap.end() && j->second.mRTTI->IsKindOf(link.mRTTI))
|
|
{
|
|
{
|
|
const ObjectInfo &obj_info = j->second;
|
|
const ObjectInfo &obj_info = j->second;
|
|
|
|
|
|
@@ -144,14 +144,14 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
*link.mPointer = obj_info.mInstance;
|
|
*link.mPointer = obj_info.mInstance;
|
|
|
|
|
|
// Increment refcount if it was a referencing pointer
|
|
// Increment refcount if it was a referencing pointer
|
|
- if (link.mRefCountOffset != -1)
|
|
|
|
|
|
+ if (link.mRefCountOffset != -1)
|
|
++(*(uint32 *)(((uint8 *)obj_info.mInstance) + link.mRefCountOffset));
|
|
++(*(uint32 *)(((uint8 *)obj_info.mInstance) + link.mRefCountOffset));
|
|
-
|
|
|
|
|
|
+
|
|
// Add referenced object to the list
|
|
// Add referenced object to the list
|
|
if (referenced_objects.find(obj_info.mInstance) == referenced_objects.end())
|
|
if (referenced_objects.find(obj_info.mInstance) == referenced_objects.end())
|
|
referenced_objects.insert(obj_info.mInstance);
|
|
referenced_objects.insert(obj_info.mInstance);
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// Referenced object not found, set pointer to nullptr
|
|
// Referenced object not found, set pointer to nullptr
|
|
Trace("ObjectStreamIn: Setting incorrect pointer to class of type %s to nullptr.", link.mRTTI->GetName());
|
|
Trace("ObjectStreamIn: Setting incorrect pointer to class of type %s to nullptr.", link.mRTTI->GetName());
|
|
@@ -160,14 +160,14 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
}
|
|
}
|
|
|
|
|
|
// Release unreferenced objects except the main object
|
|
// Release unreferenced objects except the main object
|
|
- for (const IdentifierMap::value_type &j : mIdentifierMap)
|
|
|
|
|
|
+ for (const IdentifierMap::value_type &j : mIdentifierMap)
|
|
{
|
|
{
|
|
const ObjectInfo &obj_info = j.second;
|
|
const ObjectInfo &obj_info = j.second;
|
|
|
|
|
|
- if (obj_info.mInstance != main_object)
|
|
|
|
|
|
+ if (obj_info.mInstance != main_object)
|
|
{
|
|
{
|
|
ObjectSet::const_iterator k = referenced_objects.find(obj_info.mInstance);
|
|
ObjectSet::const_iterator k = referenced_objects.find(obj_info.mInstance);
|
|
- if (k == referenced_objects.end())
|
|
|
|
|
|
+ if (k == referenced_objects.end())
|
|
{
|
|
{
|
|
Trace("ObjectStreamIn: Releasing unreferenced object of type %s.", obj_info.mRTTI->GetName());
|
|
Trace("ObjectStreamIn: Releasing unreferenced object of type %s.", obj_info.mRTTI->GetName());
|
|
obj_info.mRTTI->DestructObject(obj_info.mInstance);
|
|
obj_info.mRTTI->DestructObject(obj_info.mInstance);
|
|
@@ -180,7 +180,7 @@ void *ObjectStreamIn::Read(const RTTI *inRTTI)
|
|
else
|
|
else
|
|
{
|
|
{
|
|
// Release all objects if a fatal error occurred
|
|
// Release all objects if a fatal error occurred
|
|
- for (const IdentifierMap::value_type &i : mIdentifierMap)
|
|
|
|
|
|
+ for (const IdentifierMap::value_type &i : mIdentifierMap)
|
|
{
|
|
{
|
|
const ObjectInfo &obj_info = i.second;
|
|
const ObjectInfo &obj_info = i.second;
|
|
obj_info.mRTTI->DestructObject(obj_info.mInstance);
|
|
obj_info.mRTTI->DestructObject(obj_info.mInstance);
|
|
@@ -195,41 +195,41 @@ void *ObjectStreamIn::ReadObject(const RTTI *& outRTTI)
|
|
// Read the object class
|
|
// Read the object class
|
|
void *object = nullptr;
|
|
void *object = nullptr;
|
|
String class_name;
|
|
String class_name;
|
|
- if (ReadName(class_name))
|
|
|
|
|
|
+ if (ReadName(class_name))
|
|
{
|
|
{
|
|
// Get class description
|
|
// Get class description
|
|
ClassDescriptionMap::iterator i = mClassDescriptionMap.find(class_name);
|
|
ClassDescriptionMap::iterator i = mClassDescriptionMap.find(class_name);
|
|
- if (i != mClassDescriptionMap.end())
|
|
|
|
|
|
+ if (i != mClassDescriptionMap.end())
|
|
{
|
|
{
|
|
const ClassDescription &class_desc = i->second;
|
|
const ClassDescription &class_desc = i->second;
|
|
|
|
|
|
// Read object identifier
|
|
// Read object identifier
|
|
Identifier identifier;
|
|
Identifier identifier;
|
|
- if (ReadIdentifier(identifier))
|
|
|
|
|
|
+ if (ReadIdentifier(identifier))
|
|
{
|
|
{
|
|
// Check if this object can be read or must be skipped
|
|
// Check if this object can be read or must be skipped
|
|
- if (identifier != sNullIdentifier
|
|
|
|
|
|
+ if (identifier != sNullIdentifier
|
|
&& class_desc.mRTTI
|
|
&& class_desc.mRTTI
|
|
- && !class_desc.mRTTI->IsAbstract())
|
|
|
|
|
|
+ && !class_desc.mRTTI->IsAbstract())
|
|
{
|
|
{
|
|
// Create object instance
|
|
// Create object instance
|
|
outRTTI = class_desc.mRTTI;
|
|
outRTTI = class_desc.mRTTI;
|
|
object = outRTTI->CreateObject();
|
|
object = outRTTI->CreateObject();
|
|
|
|
|
|
// Read object attributes
|
|
// Read object attributes
|
|
- if (ReadClassData(class_desc, object))
|
|
|
|
|
|
+ if (ReadClassData(class_desc, object))
|
|
{
|
|
{
|
|
// Add object to identifier map
|
|
// Add object to identifier map
|
|
mIdentifierMap.try_emplace(identifier, object, outRTTI);
|
|
mIdentifierMap.try_emplace(identifier, object, outRTTI);
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// Fatal error while reading attributes, release object
|
|
// Fatal error while reading attributes, release object
|
|
outRTTI->DestructObject(object);
|
|
outRTTI->DestructObject(object);
|
|
object = nullptr;
|
|
object = nullptr;
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// Skip this object
|
|
// Skip this object
|
|
// TODO: This operation can fail, but there is no check yet
|
|
// TODO: This operation can fail, but there is no check yet
|
|
@@ -237,8 +237,8 @@ void *ObjectStreamIn::ReadObject(const RTTI *& outRTTI)
|
|
ReadClassData(class_desc, nullptr);
|
|
ReadClassData(class_desc, nullptr);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// TODO: This is a fatal error, but this function has no way of indicating this
|
|
// TODO: This is a fatal error, but this function has no way of indicating this
|
|
Trace("ObjectStreamIn: Found object of unknown class %s.", class_name.c_str());
|
|
Trace("ObjectStreamIn: Found object of unknown class %s.", class_name.c_str());
|
|
@@ -252,10 +252,10 @@ bool ObjectStreamIn::ReadRTTI()
|
|
{
|
|
{
|
|
// Read class name and find it's attribute info
|
|
// Read class name and find it's attribute info
|
|
String class_name;
|
|
String class_name;
|
|
- if (!ReadName(class_name))
|
|
|
|
|
|
+ if (!ReadName(class_name))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- // Find class
|
|
|
|
|
|
+ // Find class
|
|
const RTTI *rtti = Factory::sInstance->Find(class_name.c_str());
|
|
const RTTI *rtti = Factory::sInstance->Find(class_name.c_str());
|
|
if (rtti == nullptr)
|
|
if (rtti == nullptr)
|
|
Trace("ObjectStreamIn: Unknown class: \"%s\".", class_name.c_str());
|
|
Trace("ObjectStreamIn: Unknown class: \"%s\".", class_name.c_str());
|
|
@@ -265,44 +265,44 @@ bool ObjectStreamIn::ReadRTTI()
|
|
|
|
|
|
// Read the number of entries in the description
|
|
// Read the number of entries in the description
|
|
uint32 count;
|
|
uint32 count;
|
|
- if (!ReadCount(count))
|
|
|
|
|
|
+ if (!ReadCount(count))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
// Read the entries
|
|
// Read the entries
|
|
- for (uint32 i = 0; i < count; ++i)
|
|
|
|
|
|
+ for (uint32 i = 0; i < count; ++i)
|
|
{
|
|
{
|
|
AttributeDescription attribute;
|
|
AttributeDescription attribute;
|
|
-
|
|
|
|
|
|
+
|
|
// Read name
|
|
// Read name
|
|
String attribute_name;
|
|
String attribute_name;
|
|
- if (!ReadName(attribute_name))
|
|
|
|
|
|
+ if (!ReadName(attribute_name))
|
|
return false;
|
|
return false;
|
|
-
|
|
|
|
|
|
+
|
|
// Read type
|
|
// Read type
|
|
- if (!ReadDataType(attribute.mSourceType))
|
|
|
|
|
|
+ if (!ReadDataType(attribute.mSourceType))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
// Read array depth
|
|
// Read array depth
|
|
- while (attribute.mSourceType == EOSDataType::Array)
|
|
|
|
|
|
+ while (attribute.mSourceType == EOSDataType::Array)
|
|
{
|
|
{
|
|
++attribute.mArrayDepth;
|
|
++attribute.mArrayDepth;
|
|
- if (!ReadDataType(attribute.mSourceType))
|
|
|
|
|
|
+ if (!ReadDataType(attribute.mSourceType))
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
// Read instance/pointer class name
|
|
// Read instance/pointer class name
|
|
- if ((attribute.mSourceType == EOSDataType::Instance || attribute.mSourceType == EOSDataType::Pointer)
|
|
|
|
- && !ReadName(attribute.mClassName))
|
|
|
|
|
|
+ if ((attribute.mSourceType == EOSDataType::Instance || attribute.mSourceType == EOSDataType::Pointer)
|
|
|
|
+ && !ReadName(attribute.mClassName))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
// Find attribute in rtti
|
|
// Find attribute in rtti
|
|
- if (rtti)
|
|
|
|
|
|
+ if (rtti)
|
|
{
|
|
{
|
|
// Find attribute index
|
|
// Find attribute index
|
|
for (int idx = 0; idx < rtti->GetAttributeCount(); ++idx)
|
|
for (int idx = 0; idx < rtti->GetAttributeCount(); ++idx)
|
|
{
|
|
{
|
|
const SerializableAttribute &attr = rtti->GetAttribute(idx);
|
|
const SerializableAttribute &attr = rtti->GetAttribute(idx);
|
|
- if (strcmp(attr.GetName(), attribute_name.c_str()) == 0)
|
|
|
|
|
|
+ if (strcmp(attr.GetName(), attribute_name.c_str()) == 0)
|
|
{
|
|
{
|
|
attribute.mIndex = idx;
|
|
attribute.mIndex = idx;
|
|
break;
|
|
break;
|
|
@@ -334,7 +334,7 @@ bool ObjectStreamIn::ReadRTTI()
|
|
attribute.mIndex = -1;
|
|
attribute.mIndex = -1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
// Add attribute to the class description
|
|
// Add attribute to the class description
|
|
class_desc.mAttributes.push_back(attribute);
|
|
class_desc.mAttributes.push_back(attribute);
|
|
@@ -357,7 +357,7 @@ bool ObjectStreamIn::ReadClassData(const ClassDescription &inClassDesc, void *in
|
|
{
|
|
{
|
|
// Read data for this class
|
|
// Read data for this class
|
|
bool continue_reading = true;
|
|
bool continue_reading = true;
|
|
-
|
|
|
|
|
|
+
|
|
for (const AttributeDescription &attr_desc : inClassDesc.mAttributes)
|
|
for (const AttributeDescription &attr_desc : inClassDesc.mAttributes)
|
|
{
|
|
{
|
|
// Read or skip the attribute data
|
|
// Read or skip the attribute data
|
|
@@ -403,14 +403,14 @@ bool ObjectStreamIn::ReadClassData(const ClassDescription &inClassDesc, void *in
|
|
bool ObjectStreamIn::ReadPointerData(const RTTI *inRTTI, void **inPointer, int inRefCountOffset)
|
|
bool ObjectStreamIn::ReadPointerData(const RTTI *inRTTI, void **inPointer, int inRefCountOffset)
|
|
{
|
|
{
|
|
Identifier identifier;
|
|
Identifier identifier;
|
|
- if (ReadIdentifier(identifier))
|
|
|
|
|
|
+ if (ReadIdentifier(identifier))
|
|
{
|
|
{
|
|
- if (identifier == sNullIdentifier)
|
|
|
|
|
|
+ if (identifier == sNullIdentifier)
|
|
{
|
|
{
|
|
// Set nullptr pointer
|
|
// Set nullptr pointer
|
|
inPointer = nullptr;
|
|
inPointer = nullptr;
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// Put pointer on the list to be resolved later on
|
|
// Put pointer on the list to be resolved later on
|
|
mUnresolvedLinks.emplace_back();
|
|
mUnresolvedLinks.emplace_back();
|
|
@@ -432,15 +432,15 @@ bool ObjectStreamIn::SkipAttributeData(int inArrayDepth, EOSDataType inDataType,
|
|
|
|
|
|
// Get number of items to read
|
|
// Get number of items to read
|
|
uint32 count = 1;
|
|
uint32 count = 1;
|
|
- for (; inArrayDepth > 0; --inArrayDepth)
|
|
|
|
|
|
+ for (; inArrayDepth > 0; --inArrayDepth)
|
|
{
|
|
{
|
|
uint32 temporary;
|
|
uint32 temporary;
|
|
- if (ReadCount(temporary))
|
|
|
|
|
|
+ if (ReadCount(temporary))
|
|
{
|
|
{
|
|
// Multiply for multi dimensional arrays
|
|
// Multiply for multi dimensional arrays
|
|
count *= temporary;
|
|
count *= temporary;
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
// Fatal error while reading array size
|
|
// Fatal error while reading array size
|
|
continue_reading = false;
|
|
continue_reading = false;
|
|
@@ -449,150 +449,150 @@ bool ObjectStreamIn::SkipAttributeData(int inArrayDepth, EOSDataType inDataType,
|
|
}
|
|
}
|
|
|
|
|
|
// Read data for all items
|
|
// Read data for all items
|
|
- if (continue_reading)
|
|
|
|
|
|
+ if (continue_reading)
|
|
{
|
|
{
|
|
- if (inDataType == EOSDataType::Instance)
|
|
|
|
|
|
+ if (inDataType == EOSDataType::Instance)
|
|
{
|
|
{
|
|
// Get the class description
|
|
// Get the class description
|
|
ClassDescriptionMap::iterator i = mClassDescriptionMap.find(inClassName);
|
|
ClassDescriptionMap::iterator i = mClassDescriptionMap.find(inClassName);
|
|
- if (i != mClassDescriptionMap.end())
|
|
|
|
- {
|
|
|
|
|
|
+ if (i != mClassDescriptionMap.end())
|
|
|
|
+ {
|
|
for (; count > 0 && continue_reading; --count)
|
|
for (; count > 0 && continue_reading; --count)
|
|
continue_reading = ReadClassData(i->second, nullptr);
|
|
continue_reading = ReadClassData(i->second, nullptr);
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
continue_reading = false;
|
|
continue_reading = false;
|
|
Trace("ObjectStreamIn: Found instance of unknown class %s.", inClassName);
|
|
Trace("ObjectStreamIn: Found instance of unknown class %s.", inClassName);
|
|
}
|
|
}
|
|
- }
|
|
|
|
- else
|
|
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- for (; count > 0 && continue_reading; --count)
|
|
|
|
|
|
+ for (; count > 0 && continue_reading; --count)
|
|
{
|
|
{
|
|
- switch (inDataType)
|
|
|
|
|
|
+ switch (inDataType)
|
|
{
|
|
{
|
|
case EOSDataType::Pointer:
|
|
case EOSDataType::Pointer:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Identifier temporary;
|
|
Identifier temporary;
|
|
continue_reading = ReadIdentifier(temporary);
|
|
continue_reading = ReadIdentifier(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_uint8:
|
|
case EOSDataType::T_uint8:
|
|
- {
|
|
|
|
|
|
+ {
|
|
uint8 temporary;
|
|
uint8 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_uint16:
|
|
case EOSDataType::T_uint16:
|
|
- {
|
|
|
|
|
|
+ {
|
|
uint16 temporary;
|
|
uint16 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_int:
|
|
case EOSDataType::T_int:
|
|
- {
|
|
|
|
|
|
+ {
|
|
int temporary;
|
|
int temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_uint32:
|
|
case EOSDataType::T_uint32:
|
|
- {
|
|
|
|
|
|
+ {
|
|
uint32 temporary;
|
|
uint32 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_uint64:
|
|
case EOSDataType::T_uint64:
|
|
- {
|
|
|
|
|
|
+ {
|
|
uint64 temporary;
|
|
uint64 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_float:
|
|
case EOSDataType::T_float:
|
|
- {
|
|
|
|
|
|
+ {
|
|
float temporary;
|
|
float temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_double:
|
|
case EOSDataType::T_double:
|
|
- {
|
|
|
|
|
|
+ {
|
|
double temporary;
|
|
double temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_bool:
|
|
case EOSDataType::T_bool:
|
|
- {
|
|
|
|
|
|
+ {
|
|
bool temporary;
|
|
bool temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
case EOSDataType::T_String:
|
|
case EOSDataType::T_String:
|
|
- {
|
|
|
|
|
|
+ {
|
|
String temporary;
|
|
String temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Float3:
|
|
case EOSDataType::T_Float3:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Float3 temporary;
|
|
Float3 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Double3:
|
|
case EOSDataType::T_Double3:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Double3 temporary;
|
|
Double3 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Vec3:
|
|
case EOSDataType::T_Vec3:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Vec3 temporary;
|
|
Vec3 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_DVec3:
|
|
case EOSDataType::T_DVec3:
|
|
- {
|
|
|
|
|
|
+ {
|
|
DVec3 temporary;
|
|
DVec3 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Vec4:
|
|
case EOSDataType::T_Vec4:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Vec4 temporary;
|
|
Vec4 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Quat:
|
|
case EOSDataType::T_Quat:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Quat temporary;
|
|
Quat temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_Mat44:
|
|
case EOSDataType::T_Mat44:
|
|
- {
|
|
|
|
|
|
+ {
|
|
Mat44 temporary;
|
|
Mat44 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
case EOSDataType::T_DMat44:
|
|
case EOSDataType::T_DMat44:
|
|
- {
|
|
|
|
|
|
+ {
|
|
DMat44 temporary;
|
|
DMat44 temporary;
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
continue_reading = ReadPrimitiveData(temporary);
|
|
break;
|
|
break;
|