mirror of https://github.com/AxioDL/tinyxml2.git
a few formatting changes
This commit is contained in:
parent
d7e033ec0c
commit
5ce8941553
17
tinyxml2.cpp
17
tinyxml2.cpp
|
@ -23,10 +23,19 @@ distribution.
|
||||||
|
|
||||||
#include "tinyxml2.h"
|
#include "tinyxml2.h"
|
||||||
|
|
||||||
#include <cstdarg>
|
#if 1
|
||||||
#include <cstdio>
|
#include <cstdarg>
|
||||||
#include <cstdlib>
|
#include <cstdio>
|
||||||
#include <new>
|
#include <cstdlib>
|
||||||
|
#include <new>
|
||||||
|
#else
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <new>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
|
|
||||||
|
|
33
tinyxml2.h
33
tinyxml2.h
|
@ -24,12 +24,19 @@ distribution.
|
||||||
#ifndef TINYXML2_INCLUDED
|
#ifndef TINYXML2_INCLUDED
|
||||||
#define TINYXML2_INCLUDED
|
#define TINYXML2_INCLUDED
|
||||||
|
|
||||||
#include <cctype>
|
#if 1
|
||||||
#include <climits>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <climits>
|
||||||
#include <cstring>
|
#include <cstdio>
|
||||||
#if __APPLE__
|
#include <cstring>
|
||||||
# include <memory.h>
|
#else
|
||||||
|
// Not completely sure all the interesting systems
|
||||||
|
// can handle the new headers; can switch this if
|
||||||
|
// there is an include problem.
|
||||||
|
#include <limits.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <memory.h> // Needed by mac.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -127,9 +134,9 @@ public:
|
||||||
StrPair() : flags( 0 ), start( 0 ), end( 0 ) {}
|
StrPair() : flags( 0 ), start( 0 ), end( 0 ) {}
|
||||||
~StrPair();
|
~StrPair();
|
||||||
|
|
||||||
void Set( char* start_, char* end_, int flags_ ) {
|
void Set( char* _start, char* _end, int _flags ) {
|
||||||
Reset();
|
Reset();
|
||||||
this->start = start_; this->end = end_; this->flags = flags_ | NEEDS_FLUSH;
|
this->start = _start; this->end = _end; this->flags = _flags | NEEDS_FLUSH;
|
||||||
}
|
}
|
||||||
const char* GetStr();
|
const char* GetStr();
|
||||||
bool Empty() const { return start == end; }
|
bool Empty() const { return start == end; }
|
||||||
|
@ -473,7 +480,7 @@ public:
|
||||||
element with the specified name.
|
element with the specified name.
|
||||||
*/
|
*/
|
||||||
const XMLElement* FirstChildElement( const char* value=0 ) const;
|
const XMLElement* FirstChildElement( const char* value=0 ) const;
|
||||||
XMLElement* FirstChildElement( const char* value_=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( value_ )); }
|
XMLElement* FirstChildElement( const char* _value=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( _value )); }
|
||||||
|
|
||||||
/// Get the last child node, or null if none exists.
|
/// Get the last child node, or null if none exists.
|
||||||
const XMLNode* LastChild() const { return lastChild; }
|
const XMLNode* LastChild() const { return lastChild; }
|
||||||
|
@ -483,7 +490,7 @@ public:
|
||||||
element with the specified name.
|
element with the specified name.
|
||||||
*/
|
*/
|
||||||
const XMLElement* LastChildElement( const char* value=0 ) const;
|
const XMLElement* LastChildElement( const char* value=0 ) const;
|
||||||
XMLElement* LastChildElement( const char* value_=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(value_) ); }
|
XMLElement* LastChildElement( const char* _value=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(_value) ); }
|
||||||
|
|
||||||
/// Get the previous (left) sibling node of this node.
|
/// Get the previous (left) sibling node of this node.
|
||||||
const XMLNode* PreviousSibling() const { return prev; }
|
const XMLNode* PreviousSibling() const { return prev; }
|
||||||
|
@ -491,7 +498,7 @@ public:
|
||||||
|
|
||||||
/// Get the previous (left) sibling element of this node, with an opitionally supplied name.
|
/// Get the previous (left) sibling element of this node, with an opitionally supplied name.
|
||||||
const XMLElement* PreviousSiblingElement( const char* value=0 ) const ;
|
const XMLElement* PreviousSiblingElement( const char* value=0 ) const ;
|
||||||
XMLElement* PreviousSiblingElement( const char* value_=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( value_ ) ); }
|
XMLElement* PreviousSiblingElement( const char* _value=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( _value ) ); }
|
||||||
|
|
||||||
/// Get the next (right) sibling node of this node.
|
/// Get the next (right) sibling node of this node.
|
||||||
const XMLNode* NextSibling() const { return next; }
|
const XMLNode* NextSibling() const { return next; }
|
||||||
|
@ -499,7 +506,7 @@ public:
|
||||||
|
|
||||||
/// Get the next (right) sibling element of this node, with an opitionally supplied name.
|
/// Get the next (right) sibling element of this node, with an opitionally supplied name.
|
||||||
const XMLElement* NextSiblingElement( const char* value=0 ) const;
|
const XMLElement* NextSiblingElement( const char* value=0 ) const;
|
||||||
XMLElement* NextSiblingElement( const char* value_=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( value_ ) ); }
|
XMLElement* NextSiblingElement( const char* _value=0 ) { return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( _value ) ); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add a child node as the last (right) child.
|
Add a child node as the last (right) child.
|
||||||
|
@ -617,7 +624,7 @@ public:
|
||||||
virtual const XMLText* ToText() const { return this; }
|
virtual const XMLText* ToText() const { return this; }
|
||||||
|
|
||||||
/// Declare whether this should be CDATA or standard text.
|
/// Declare whether this should be CDATA or standard text.
|
||||||
void SetCData( bool isCData_ ) { this->isCData = isCData_; }
|
void SetCData( bool _isCData ) { this->isCData = _isCData; }
|
||||||
/// Returns true if this is a CDATA text element.
|
/// Returns true if this is a CDATA text element.
|
||||||
bool CData() const { return isCData; }
|
bool CData() const { return isCData; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue