basic structure in place.
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index e923c48..aa3788f 100644
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <ctype.h>
using namespace tinyxml2;
@@ -23,14 +24,49 @@
}
+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: <!--
+ // - Decleration: <?xml
+ // - Everthing else is unknown to tinyxml.
+ //
+
+ const char* xmlHeader = { "<?xml" };
+ const char* commentHeader = { "<!--" };
+ const char* dtdHeader = { "<!" };
+ const char* cdataHeader = { "<![CDATA[" };
+
+ if ( XMLNode::StringEqual( p, xmlHeader, 5 ) ) {
+
+ }
+ else {
+ TIXMLASSERT( 0 );
+ }
return true;
}