From 4cee61104d83f790a2d7e52ac96015f193f3ac53 Mon Sep 17 00:00:00 2001 From: "U-Lama\\Lee" Date: Sat, 31 Dec 2011 14:58:18 -0800 Subject: [PATCH] basic structure in place. --- tinyxml2.cpp | 38 ++++++++++++++++++++++++++++++- tinyxml2.h | 62 +++++++++++++++++++++++++++++++++++++++++++++------ tinyxml2.suo | Bin 25600 -> 25600 bytes xmltest.cpp | 18 +++++++++++---- 4 files changed, 106 insertions(+), 12 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index e923c48..aa3788f 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -3,6 +3,7 @@ #include #include #include +#include using namespace tinyxml2; @@ -23,14 +24,49 @@ using namespace tinyxml2; } +const char* XMLNode::SkipWhiteSpace( const char* p ) +{ + while( isspace( *p ) ) { + ++p; + } + return p; +} + + XMLDocument::XMLDocument() : charBuffer( 0 ) { } -bool XMLDocument::Parse( const char* str ) +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: "; - XMLDocument doc; - doc.Parse( test ); - doc.Print( stdout ); + XMLDocument doc; + doc.Parse( test ); + doc.Print( stdout ); + } + /* + { + static const char* test = ""; + XMLDocument doc; + doc.Parse( test ); + doc.Print( stdout ); + } + */ return 0; } \ No newline at end of file