diff --git a/tinyxml2.cpp b/tinyxml2.cpp index eac36f9..e923c48 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -1,7 +1,36 @@ -#include "tinyxml2.h"; +#include "tinyxml2.h" + +#include +#include +#include + +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 ) { + return true; } diff --git a/tinyxml2.h b/tinyxml2.h index ce8b4a7..aa1fbba 100644 --- a/tinyxml2.h +++ b/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 { public: Element }; +*/ + class XMLDocument @@ -22,12 +37,13 @@ public: private: XMLDocument( const XMLDocument& ); // not implemented + CharBuffer* charBuffer; }; - - }; // tinyxml2 + + #endif // TINYXML2_INCLUDED \ No newline at end of file diff --git a/tinyxml2.suo b/tinyxml2.suo index 05dfa1e..345fd48 100644 Binary files a/tinyxml2.suo and b/tinyxml2.suo differ diff --git a/tinyxml2/tinyxml2.vcxproj b/tinyxml2/tinyxml2.vcxproj index a12f535..d3716bd 100644 --- a/tinyxml2/tinyxml2.vcxproj +++ b/tinyxml2/tinyxml2.vcxproj @@ -49,7 +49,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) Console