mirror of https://github.com/AxioDL/tinyxml2.git
initial thoughts
This commit is contained in:
parent
e13c3e653d
commit
560bd47842
31
tinyxml2.cpp
31
tinyxml2.cpp
|
@ -1,7 +1,36 @@
|
||||||
#include "tinyxml2.h";
|
#include "tinyxml2.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
XMLDocument::XMLDocument() :
|
||||||
|
charBuffer( 0 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool XMLDocument::Parse( const char* str )
|
bool XMLDocument::Parse( const char* str )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
20
tinyxml2.h
20
tinyxml2.h
|
@ -6,11 +6,26 @@ namespace tinyxml2
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// internal - move to separate namespace
|
||||||
|
struct CharBuffer
|
||||||
|
{
|
||||||
|
size_t length;
|
||||||
|
char mem[1];
|
||||||
|
|
||||||
|
static CharBuffer* Construct( const char* in );
|
||||||
|
static void Free( CharBuffer* );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
class Element
|
class Element
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Element
|
Element
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class XMLDocument
|
class XMLDocument
|
||||||
|
@ -22,12 +37,13 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
XMLDocument( const XMLDocument& ); // not implemented
|
XMLDocument( const XMLDocument& ); // not implemented
|
||||||
|
CharBuffer* charBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}; // tinyxml2
|
}; // tinyxml2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // TINYXML2_INCLUDED
|
#endif // TINYXML2_INCLUDED
|
BIN
tinyxml2.suo
BIN
tinyxml2.suo
Binary file not shown.
|
@ -49,7 +49,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
|
Loading…
Reference in New Issue