re-add typedefs

This commit is contained in:
Chris Danford
2005-01-07 03:18:11 +00:00
parent a864f8372c
commit afc06a1d92
2 changed files with 23 additions and 21 deletions
+14 -14
View File
@@ -661,9 +661,9 @@ XAttr *XNode::GetAttr( const char* attrname )
// Coder Date Desc
// bro 2002-10-29
//========================================================
vector<XAttr*> XNode::GetAttrs( const char* name )
XAttrs XNode::GetAttrs( const char* name )
{
vector<XAttr*> 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*> XNode::GetChilds()
XNodes XNode::GetChilds()
{
return childs;
}
@@ -705,9 +705,9 @@ vector<XNode*> XNode::GetChilds()
// Coder Date Desc
// bro 2002-10-29
//========================================================
vector<XNode*> XNode::GetChilds( const char* name )
XNodes XNode::GetChilds( const char* name )
{
vector<XNode*> 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<XNode*>::iterator XNode::GetChildIterator( XNode *node )
XNodes::iterator XNode::GetChildIterator( XNode *node )
{
vector<XNode*>::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<XNode*>::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<XAttr*>::iterator
// Return : XAttrs::iterator
//--------------------------------------------------------
// Coder Date Desc
// bro 2002-10-29
//========================================================
vector<XAttr*>::iterator XNode::GetAttrIterator( XAttr *attr )
XAttrs::iterator XNode::GetAttrIterator( XAttr *attr )
{
vector<XAttr*>::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<XAttr*>::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<XNode*>::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<XAttr*>::iterator it = GetAttrIterator( attr );
XAttrs::iterator it = GetAttrIterator( attr );
if( it != attrs.end() )
{
attrs.erase( it );
+9 -7
View File
@@ -24,7 +24,9 @@ struct DateTime;
class RageFileBasic;
struct XAttr;
typedef vector<XAttr*> XAttrs;
struct XNode;
typedef vector<XNode*> XNodes;
// Entity Encode/Decode Support
struct XENTITY
@@ -138,8 +140,8 @@ struct XNode
// internal variables
XNode *parent; // parent node
vector<XNode*> childs; // child node
vector<XAttr*> 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<XAttr*> 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<XNode*> GetChilds( const char* name );
vector<XNode*> 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<XNode*>::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<XAttr*>::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 );