diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index d61779374a..33fbb51018 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -661,9 +661,9 @@ XAttr *XNode::GetAttr( const char* attrname ) // Coder Date Desc // bro 2002-10-29 //======================================================== -vector XNode::GetAttrs( const char* name ) +XAttrs XNode::GetAttrs( const char* name ) { - vector attrs; + XAttrs attrs; for( unsigned i = 0 ; i < attrs.size(); i++ ) { XAttr *attr = attrs[i]; @@ -691,7 +691,7 @@ const char* XNode::GetAttrValue( const char* attrname ) return attr ? (const char*)attr->value : NULL; } -vector XNode::GetChilds() +XNodes XNode::GetChilds() { return childs; } @@ -705,9 +705,9 @@ vector XNode::GetChilds() // Coder Date Desc // bro 2002-10-29 //======================================================== -vector XNode::GetChilds( const char* name ) +XNodes XNode::GetChilds( const char* name ) { - vector nodes; + XNodes nodes; for( unsigned i = 0 ; i < childs.size(); i++ ) { XNode *node = childs[i]; @@ -824,9 +824,9 @@ const char* XNode::GetChildAttrValue( const char* name, const char* attrname ) // Coder Date Desc // bro 2002-10-29 //======================================================== -vector::iterator XNode::GetChildIterator( XNode *node ) +XNodes::iterator XNode::GetChildIterator( XNode *node ) { - vector::iterator it = childs.begin(); + XNodes::iterator it = childs.begin(); for( ; it != childs.end() ; ++(it) ) { if( *it == node ) @@ -877,7 +877,7 @@ XNode *XNode::AppendChild( XNode *node ) //======================================================== bool XNode::RemoveChild( XNode *node ) { - vector::iterator it = GetChildIterator( node ); + XNodes::iterator it = GetChildIterator( node ); if( it != childs.end() ) { delete *it; @@ -907,14 +907,14 @@ XAttr *XNode::GetAttr( int i ) // Name : GetAttrIterator // Desc : get attribute iterator // Param : -// Return : vector::iterator +// Return : XAttrs::iterator //-------------------------------------------------------- // Coder Date Desc // bro 2002-10-29 //======================================================== -vector::iterator XNode::GetAttrIterator( XAttr *attr ) +XAttrs::iterator XNode::GetAttrIterator( XAttr *attr ) { - vector::iterator it = attrs.begin(); + XAttrs::iterator it = attrs.begin(); for( ; it != attrs.end() ; ++(it) ) { if( *it == attr ) @@ -950,7 +950,7 @@ XAttr *XNode::AppendAttr( XAttr *attr ) //======================================================== bool XNode::RemoveAttr( XAttr *attr ) { - vector::iterator it = GetAttrIterator( attr ); + XAttrs::iterator it = GetAttrIterator( attr ); if( it != attrs.end() ) { delete *it; @@ -1023,7 +1023,7 @@ XAttr *XNode::AppendAttr( const char* name, unsigned value ) { return AppendAttr //======================================================== XNode *XNode::DetachChild( XNode *node ) { - vector::iterator it = GetChildIterator( node ); + XNodes::iterator it = GetChildIterator( node ); if( it != childs.end() ) { childs.erase( it ); @@ -1043,7 +1043,7 @@ XNode *XNode::DetachChild( XNode *node ) //======================================================== XAttr *XNode::DetachAttr( XAttr *attr ) { - vector::iterator it = GetAttrIterator( attr ); + XAttrs::iterator it = GetAttrIterator( attr ); if( it != attrs.end() ) { attrs.erase( it ); diff --git a/stepmania/src/XmlFile.h b/stepmania/src/XmlFile.h index e12b797f69..8538829fc1 100644 --- a/stepmania/src/XmlFile.h +++ b/stepmania/src/XmlFile.h @@ -24,7 +24,9 @@ struct DateTime; class RageFileBasic; struct XAttr; +typedef vector XAttrs; struct XNode; +typedef vector XNodes; // Entity Encode/Decode Support struct XENTITY @@ -138,8 +140,8 @@ struct XNode // internal variables XNode *parent; // parent node - vector childs; // child node - vector attrs; // attributes + XNodes childs; // child node + XAttrs attrs; // attributes // Load/Save XML char* Load( const char* pszXml, PARSEINFO *pi = &piDefault ); @@ -160,7 +162,7 @@ struct XNode bool GetAttrValue(const char* name,bool &out) const { const XAttr* pAttr=GetAttr(name); if(pAttr==NULL) return false; pAttr->GetValue(out); return true; } bool GetAttrValue(const char* name,unsigned &out) const { const XAttr* pAttr=GetAttr(name); if(pAttr==NULL) return false; pAttr->GetValue(out); return true; } bool GetAttrValue(const char* name,DateTime &out) const { const XAttr* pAttr=GetAttr(name); if(pAttr==NULL) return false; pAttr->GetValue(out); return true; } - vector GetAttrs( const char* name ); + XAttrs GetAttrs( const char* name ); // in one level child nodes const XNode *GetChild( const char* name ) const; @@ -172,8 +174,8 @@ struct XNode bool GetChildValue(const char* name,bool &out) const { const XNode* pChild=GetChild(name); if(pChild==NULL) return false; pChild->GetValue(out); return true; } bool GetChildValue(const char* name,unsigned &out) const{ const XNode* pChild=GetChild(name); if(pChild==NULL) return false; pChild->GetValue(out); return true; } bool GetChildValue(const char* name,DateTime &out) const{ const XNode* pChild=GetChild(name); if(pChild==NULL) return false; pChild->GetValue(out); return true; } - vector GetChilds( const char* name ); - vector GetChilds(); + XNodes GetChilds( const char* name ); + XNodes GetChilds(); XAttr *GetChildAttr( const char* name, const char* attrname ); const char* GetChildAttrValue( const char* name, const char* attrname ); @@ -181,7 +183,7 @@ struct XNode // modify DOM int GetChildCount(); XNode *GetChild( int i ); - vector::iterator GetChildIterator( XNode *node ); + XNodes::iterator GetChildIterator( XNode *node ); XNode *CreateNode( const char* name = NULL, const char* value = NULL ); XNode *AppendChild( const char* name = NULL, const char* value = NULL ); XNode *AppendChild( const char* name, float value ); @@ -194,7 +196,7 @@ struct XNode XAttr *GetAttr( int i ); - vector::iterator GetAttrIterator( XAttr *node ); + XAttrs::iterator GetAttrIterator( XAttr *node ); XAttr *CreateAttr( const char* anem = NULL, const char* value = NULL ); XAttr *AppendAttr( const char* name = NULL, const char* value = NULL ); XAttr *AppendAttr( const char* name, float value );