basic structure in place.

This commit is contained in:
U-Lama\Lee
2011-12-31 14:58:18 -08:00
parent 560bd47842
commit 4cee61104d
4 changed files with 106 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
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: <!--
// - 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;
}