#include "tinyxml2.h" #include #include #include #include using namespace tinyxml2; /*static*/ CharBuffer* CharBuffer::Construct( const char* in ) { size_t len = strlen( in ); size_t size = len + sizeof( CharBuffer ); CharBuffer* cb = (CharBuffer*) malloc( size ); cb->length = len; strcpy( cb->mem, in ); return cb; } /*static*/ void CharBuffer::Free( CharBuffer* cb ) { free( cb ); } const char* XMLNode::SkipWhiteSpace( const char* p ) { while( isspace( *p ) ) { ++p; } return p; } XMLDocument::XMLDocument() : charBuffer( 0 ) { } bool XMLDocument::Parse( const char* p ) { XMLNode* returnNode = 0; p = XMLNode::SkipWhiteSpace( p ); if( !p || !*p || *p != '<' ) { return 0; } // What is this thing? // - Elements start with a letter or underscore, but xml is reserved. // - Comments: