Merge pull request #1473 from Tribes2-SCP/tinyXMLFix

Fix TinyXML Build errors
This commit is contained in:
Areloch 2015-12-21 01:10:15 -06:00
commit 24dc8e6990

View file

@ -48,7 +48,7 @@
#include "console/simObjectRef.h" #include "console/simObjectRef.h"
#endif #endif
#ifndef TINYXML_INCLUDED #ifndef TINYXML_INCLUDED
#include "tinyXML/tinyxml.h" #include "tinyxml.h"
#endif #endif
/// @file /// @file
@ -212,7 +212,7 @@ public:
/// ///
/// @param conIdPtr Pointer to the static S32 console ID. /// @param conIdPtr Pointer to the static S32 console ID.
/// @param conTypeName Console type name. /// @param conTypeName Console type name.
AbstractClassRep( S32* conIdPtr, const char* typeName ) AbstractClassRep( S32* conIdPtr, const char* typeName )
: Parent( sizeof( void* ), conIdPtr, typeName ) : Parent( sizeof( void* ), conIdPtr, typeName )
{ {
VECTOR_SET_ASSOCIATION( mFieldList ); VECTOR_SET_ASSOCIATION( mFieldList );
@ -323,13 +323,13 @@ public:
/// Return the namespace that contains the methods of this class. /// Return the namespace that contains the methods of this class.
Namespace* getNameSpace() const { return mNamespace; } Namespace* getNameSpace() const { return mNamespace; }
/// Return the AbstractClassRep of the class that this class is derived from. /// Return the AbstractClassRep of the class that this class is derived from.
AbstractClassRep* getParentClass() const { return parentClass; } AbstractClassRep* getParentClass() const { return parentClass; }
virtual AbstractClassRep* getContainerChildClass(const bool recurse) = 0; virtual AbstractClassRep* getContainerChildClass(const bool recurse) = 0;
virtual WriteCustomTamlSchema getCustomTamlSchema(void) = 0; virtual WriteCustomTamlSchema getCustomTamlSchema(void) = 0;
/// Return the size of instances of this class in bytes. /// Return the size of instances of this class in bytes.
S32 getSizeof() const { return mClassSizeof; } S32 getSizeof() const { return mClassSizeof; }
@ -396,7 +396,7 @@ protected:
Namespace * mNamespace; Namespace * mNamespace;
/// @} /// @}
public: public:
bool mIsRenderEnabled; bool mIsRenderEnabled;
@ -404,23 +404,23 @@ public:
bool isRenderEnabled() const { return mIsRenderEnabled; } bool isRenderEnabled() const { return mIsRenderEnabled; }
bool isSelectionEnabled() const { return mIsSelectionEnabled; } bool isSelectionEnabled() const { return mIsSelectionEnabled; }
/// @name Categories /// @name Categories
/// @{ /// @{
protected: protected:
const char* mCategory; const char* mCategory;
const char* mDescription; const char* mDescription;
public: public:
/// Return the space separated category path for the class. /// Return the space separated category path for the class.
const char* getCategory() const { return mCategory; } const char* getCategory() const { return mCategory; }
/// Return a short description string suitable for displaying in tooltips. /// Return a short description string suitable for displaying in tooltips.
const char* getDescription() const { return mDescription; } const char* getDescription() const { return mDescription; }
/// @} /// @}
/// @name Fields /// @name Fields
@ -434,16 +434,12 @@ public:
/// This is a function pointer typedef to support optional writing for fields. /// This is a function pointer typedef to support optional writing for fields.
typedef bool(*WriteDataNotify)(void* obj, StringTableEntry pFieldName); typedef bool(*WriteDataNotify)(void* obj, StringTableEntry pFieldName);
/// Allows the writing of a custom TAML schema.
typedef void(*WriteCustomTamlSchema)(const AbstractClassRep* pClassRep, TiXmlElement* pParentElement);
/// These are special field type values used to mark /// These are special field type values used to mark
/// groups and arrays in the field list. /// groups and arrays in the field list.
/// @see Field::type /// @see Field::type
/// @see addArray, endArray /// @see addArray, endArray
/// @see addGroup, endGroup /// @see addGroup, endGroup
/// @see addGroup, endGroup /// @see addGroup, endGroup
/// @see addDeprecatedField /// @see addDeprecatedField
enum ACRFieldTypes enum ACRFieldTypes
{ {
@ -451,35 +447,35 @@ public:
/// types greater or equal to this one are not /// types greater or equal to this one are not
/// console data types. /// console data types.
ARCFirstCustomField = 0xFFFFFFFB, ARCFirstCustomField = 0xFFFFFFFB,
/// Marks the start of a fixed size array of fields. /// Marks the start of a fixed size array of fields.
/// @see addArray /// @see addArray
StartArrayFieldType = 0xFFFFFFFB, StartArrayFieldType = 0xFFFFFFFB,
/// Marks the end of a fixed size array of fields. /// Marks the end of a fixed size array of fields.
/// @see endArray /// @see endArray
EndArrayFieldType = 0xFFFFFFFC, EndArrayFieldType = 0xFFFFFFFC,
/// Marks the beginning of a group of fields. /// Marks the beginning of a group of fields.
/// @see addGroup /// @see addGroup
StartGroupFieldType = 0xFFFFFFFD, StartGroupFieldType = 0xFFFFFFFD,
/// Marks the beginning of a group of fields. /// Marks the beginning of a group of fields.
/// @see endGroup /// @see endGroup
EndGroupFieldType = 0xFFFFFFFE, EndGroupFieldType = 0xFFFFFFFE,
/// Marks a field that is depreciated and no /// Marks a field that is depreciated and no
/// longer stores a value. /// longer stores a value.
/// @see addDeprecatedField /// @see addDeprecatedField
DeprecatedFieldType = 0xFFFFFFFF DeprecatedFieldType = 0xFFFFFFFF
}; };
enum FieldFlags enum FieldFlags
{ {
FIELD_HideInInspectors = BIT( 0 ), ///< Do not show the field in inspectors. FIELD_HideInInspectors = BIT( 0 ), ///< Do not show the field in inspectors.
}; };
struct Field struct Field
{ {
Field() Field()
: pFieldname( NULL ), : pFieldname( NULL ),
@ -525,10 +521,10 @@ public:
/// @name Console Type Interface /// @name Console Type Interface
/// @{ /// @{
virtual void* getNativeVariable() { return new ( AbstractClassRep* ); } // Any pointer-sized allocation will do. virtual void* getNativeVariable() { return new ( AbstractClassRep* ); } // Any pointer-sized allocation will do.
virtual void deleteNativeVariable( void* var ) { delete reinterpret_cast< AbstractClassRep** >( var ); } virtual void deleteNativeVariable( void* var ) { delete reinterpret_cast< AbstractClassRep** >( var ); }
/// @} /// @}
/// @name Abstract Class Database /// @name Abstract Class Database
@ -574,10 +570,10 @@ template< class T >
class ConcreteClassRep : public AbstractClassRep class ConcreteClassRep : public AbstractClassRep
{ {
public: public:
static EnginePropertyTable _smPropertyTable; static EnginePropertyTable _smPropertyTable;
static EnginePropertyTable& smPropertyTable; static EnginePropertyTable& smPropertyTable;
ConcreteClassRep( const char* name, ConcreteClassRep( const char* name,
const char* conTypeName, const char* conTypeName,
S32* conTypeIdPtr, S32* conTypeIdPtr,
@ -591,10 +587,10 @@ class ConcreteClassRep : public AbstractClassRep
mClassName = StringTable->insert( name ); mClassName = StringTable->insert( name );
mCategory = T::__category(); mCategory = T::__category();
mTypeInfo = _MAPTYPE< T >(); mTypeInfo = _MAPTYPE< T >();
if( mTypeInfo ) if( mTypeInfo )
const_cast< EngineTypeInfo* >( mTypeInfo )->mPropertyTable = &smPropertyTable; const_cast< EngineTypeInfo* >( mTypeInfo )->mPropertyTable = &smPropertyTable;
if( &T::__description != parentDesc ) if( &T::__description != parentDesc )
mDescription = T::__description(); mDescription = T::__description();
@ -642,7 +638,7 @@ class ConcreteClassRep : public AbstractClassRep
// Get handle to our parent class, if any, and ourselves (we are our parent's child). // Get handle to our parent class, if any, and ourselves (we are our parent's child).
AbstractClassRep *parent = T::getParentStaticClassRep(); AbstractClassRep *parent = T::getParentStaticClassRep();
AbstractClassRep *child = T::getStaticClassRep(); AbstractClassRep *child = T::getStaticClassRep();
// If we got reps, then link those namespaces! (To get proper inheritance.) // If we got reps, then link those namespaces! (To get proper inheritance.)
if(parent && child) if(parent && child)
Con::classLinkNamespaces(parent->getNameSpace(), child->getNameSpace()); Con::classLinkNamespaces(parent->getNameSpace(), child->getNameSpace());
@ -657,7 +653,7 @@ class ConcreteClassRep : public AbstractClassRep
/// Wrap constructor. /// Wrap constructor.
ConsoleObject* create() const { return new T; } ConsoleObject* create() const { return new T; }
/// @name Console Type Interface /// @name Console Type Interface
/// @{ /// @{
@ -671,16 +667,16 @@ class ConcreteClassRep : public AbstractClassRep
else else
Con::errorf( "Cannot set multiple args to a single ConsoleObject*."); Con::errorf( "Cannot set multiple args to a single ConsoleObject*.");
} }
virtual const char* getData( void* dptr, const EnumTable* tbl, BitSet32 flag ) virtual const char* getData( void* dptr, const EnumTable* tbl, BitSet32 flag )
{ {
T** obj = ( T** ) dptr; T** obj = ( T** ) dptr;
return Con::getReturnBuffer( T::__getObjectId( *obj ) ); return Con::getReturnBuffer( T::__getObjectId( *obj ) );
} }
virtual const char* getTypeClassName() { return mClassName; } virtual const char* getTypeClassName() { return mClassName; }
virtual const bool isDatablock() { return T::__smIsDatablock; }; virtual const bool isDatablock() { return T::__smIsDatablock; };
/// @} /// @}
}; };
@ -751,7 +747,7 @@ bool defaultProtectedWriteFn(void* obj, StringTableEntry pFieldName);
class ConsoleObject : public EngineObject class ConsoleObject : public EngineObject
{ {
DECLARE_ABSTRACT_CLASS( ConsoleObject, EngineObject ); DECLARE_ABSTRACT_CLASS( ConsoleObject, EngineObject );
protected: protected:
/// @deprecated This is disallowed. /// @deprecated This is disallowed.
@ -760,7 +756,7 @@ protected:
public: public:
ConsoleObject() {} ConsoleObject() {}
/// Get a reference to a field by name. /// Get a reference to a field by name.
const AbstractClassRep::Field *findField(StringTableEntry fieldName) const; const AbstractClassRep::Field *findField(StringTableEntry fieldName) const;
@ -769,7 +765,7 @@ public:
/// Set the value of a field. /// Set the value of a field.
bool setField(const char *fieldName, const char *value); bool setField(const char *fieldName, const char *value);
public: public:
/// @name Object Creation /// @name Object Creation
@ -799,11 +795,11 @@ public:
static void endGroup(const char* in_pGroupname); static void endGroup(const char* in_pGroupname);
/// Marks the start of a fixed size array of fields. /// Marks the start of a fixed size array of fields.
/// @see console_autodoc /// @see console_autodoc
static void addArray( const char *arrayName, S32 count ); static void addArray( const char *arrayName, S32 count );
/// Marks the end of an array of fields. /// Marks the end of an array of fields.
/// @see console_autodoc /// @see console_autodoc
static void endArray( const char *arrayName ); static void endArray( const char *arrayName );
/// Register a complex field. /// Register a complex field.
@ -928,16 +924,16 @@ public:
static bool removeField(const char* in_pFieldname); static bool removeField(const char* in_pFieldname);
/// @} /// @}
/// @name Logging /// @name Logging
/// @{ /// @{
/// Overload this in subclasses to change the message formatting. /// Overload this in subclasses to change the message formatting.
/// @param fmt A printf style format string. /// @param fmt A printf style format string.
/// @param args A va_list containing the args passed ot a log function. /// @param args A va_list containing the args passed ot a log function.
/// @note It is suggested that you use String::VToString. /// @note It is suggested that you use String::VToString.
virtual String _getLogMessage(const char* fmt, va_list args) const; virtual String _getLogMessage(const char* fmt, va_list args) const;
/// @} /// @}
public: public:
@ -946,16 +942,16 @@ public:
/// These functions will try to print out a message along the lines /// These functions will try to print out a message along the lines
/// of "ObjectClass - ObjectName(ObjectId) - formatted message" /// of "ObjectClass - ObjectName(ObjectId) - formatted message"
/// @{ /// @{
/// Logs with Con::printf. /// Logs with Con::printf.
void logMessage(const char* fmt, ...) const; void logMessage(const char* fmt, ...) const;
/// Logs with Con::warnf. /// Logs with Con::warnf.
void logWarning(const char* fmt, ...) const; void logWarning(const char* fmt, ...) const;
/// Logs with Con::errorf. /// Logs with Con::errorf.
void logError(const char* fmt, ...) const; void logError(const char* fmt, ...) const;
/// @} /// @}
/// Register dynamic fields in a subclass of ConsoleObject. /// Register dynamic fields in a subclass of ConsoleObject.
@ -1016,16 +1012,16 @@ public:
static const char* __category() { return ""; } static const char* __category() { return ""; }
static const char* __description() { return ""; } static const char* __description() { return ""; }
/// Subclasses of ConsoleObjects that are datablocks should redefine this static member variable /// Subclasses of ConsoleObjects that are datablocks should redefine this static member variable
/// and set it to true. /// and set it to true.
static const bool __smIsDatablock = false; static const bool __smIsDatablock = false;
/// @name Object IDs and lookup. /// @name Object IDs and lookup.
/// For a subclass hierarchy based on ConsoleObject to become functional for use as a console object type, /// For a subclass hierarchy based on ConsoleObject to become functional for use as a console object type,
/// the hierarchy must implement a naming scheme and indexing function for looking up objects by name. /// the hierarchy must implement a naming scheme and indexing function for looking up objects by name.
/// @{ /// @{
static ConsoleObject* __findObject( const char* ) { return NULL; } static ConsoleObject* __findObject( const char* ) { return NULL; }
static const char* __getObjectId( ConsoleObject* ) { return ""; } static const char* __getObjectId( ConsoleObject* ) { return ""; }
}; };
@ -1120,11 +1116,11 @@ inline bool& ConsoleObject::getDynamicGroupExpand()
static SimObjectRefConsoleBaseType< className > ptrRefType; \ static SimObjectRefConsoleBaseType< className > ptrRefType; \
static AbstractClassRep::WriteCustomTamlSchema getStaticWriteCustomTamlSchema(); \ static AbstractClassRep::WriteCustomTamlSchema getStaticWriteCustomTamlSchema(); \
static AbstractClassRep* getContainerChildStaticClassRep(); \ static AbstractClassRep* getContainerChildStaticClassRep(); \
virtual AbstractClassRep* getClassRep() const virtual AbstractClassRep* getClassRep() const
#define DECLARE_CATEGORY( string ) \ #define DECLARE_CATEGORY( string ) \
static const char* __category() { return string; } static const char* __category() { return string; }
#define DECLARE_DESCRIPTION( string ) \ #define DECLARE_DESCRIPTION( string ) \
static const char* __description() { return string; } static const char* __description() { return string; }
@ -1199,7 +1195,7 @@ inline bool& ConsoleObject::getDynamicGroupExpand()
AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; } \ AbstractClassRep* className::getContainerChildStaticClassRep() { return NULL; } \
AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; } \ AbstractClassRep::WriteCustomTamlSchema className::getStaticWriteCustomTamlSchema() { return NULL; } \
ConcreteClassRep<className> className::dynClassRep(#className, "Type" #className, &_smTypeId, NetClassGroupGameMask, NetClassTypeDataBlock, 0, className::getParentStaticClassRep(), &Parent::__description ) ConcreteClassRep<className> className::dynClassRep(#className, "Type" #className, &_smTypeId, NetClassGroupGameMask, NetClassTypeDataBlock, 0, className::getParentStaticClassRep(), &Parent::__description )
// Support for adding properties to classes CONOBJECT style. // Support for adding properties to classes CONOBJECT style.
#define PROPERTY_TABLE( className ) \ #define PROPERTY_TABLE( className ) \
namespace { namespace _ ## className { \ namespace { namespace _ ## className { \
@ -1209,13 +1205,13 @@ inline bool& ConsoleObject::getDynamicGroupExpand()
ConcreteClassRep< className >::smPropertyTable = _ ## className::_propTable; \ ConcreteClassRep< className >::smPropertyTable = _ ## className::_propTable; \
namespace { namespace _ ## className { \ namespace { namespace _ ## className { \
EnginePropertyTable::Property _props[] = { EnginePropertyTable::Property _props[] = {
#define END_PROPERTY_TABLE \ #define END_PROPERTY_TABLE \
{ NULL } \ { NULL } \
}; \ }; \
EnginePropertyTable _propTable( sizeof( _props ) / sizeof( _props[ 0 ] ) - 1, _props ); \ EnginePropertyTable _propTable( sizeof( _props ) / sizeof( _props[ 0 ] ) - 1, _props ); \
} } } }
/// Add an auto-doc for a class. /// Add an auto-doc for a class.
#define ConsoleDocClass( className, docString ) \ #define ConsoleDocClass( className, docString ) \
CLASSDOC( className, docString ) CLASSDOC( className, docString )
@ -1225,7 +1221,7 @@ inline bool& ConsoleObject::getDynamicGroupExpand()
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Protected field default get/set functions // Protected field default get/set functions
// //
// The reason for these functions is that it will save one branch per console // The reason for these functions is that it will save one branch per console
// data request and script functions will still execute at the same speed as // data request and script functions will still execute at the same speed as
// before the modifications to allow protected static fields. These will just // before the modifications to allow protected static fields. These will just
// inline and the code should be roughly the same size, and just as fast as // inline and the code should be roughly the same size, and just as fast as