basic structure in place.
This commit is contained in:
38
tinyxml2.cpp
38
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 @@ 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user