Browse Source

Some more tinyxml2 fixes - moved clue code to .cpp file.

Mark Sibly 9 years ago
parent
commit
9c7afd1759
3 changed files with 55 additions and 30 deletions
  1. 45 0
      modules/tinyxml2/native/glue.cpp
  2. 9 30
      modules/tinyxml2/native/glue.h
  3. 1 0
      modules/tinyxml2/tinyxml2.monkey2

+ 45 - 0
modules/tinyxml2/native/glue.cpp

@@ -0,0 +1,45 @@
+
+#include "glue.h"
+
+namespace tinyxml2{
+
+	bbString bbAttributeName( XMLAttribute *attribute ){
+		return bbString::fromUtf8String( attribute->Name() );
+	}
+	
+	bbString bbAttributeValue( XMLAttribute *attribute ){
+		return bbString::fromUtf8String( attribute->Value() );
+	}
+	
+	XMLAttribute *bbAttributeNext( XMLAttribute *attribute ){
+		return const_cast<XMLAttribute*>( attribute->Next() );
+	}
+	
+	bbString bbNodeValue( XMLNode *node ){
+		return bbString::fromUtf8String( node->Value() );
+	}
+	
+	bbString bbElementName( XMLElement *element ){
+		return bbString::fromUtf8String( element->Name() );
+	}
+	
+	bbString bbElementAttribute( XMLElement *element,bbString name,bbString value ){
+		bbUtf8String cstr( value );
+		const char *p=0;
+		if( value.length() ) p=cstr;
+		return bbString::fromUtf8String( element->Attribute( bbUtf8String( name ),p ) );
+	}
+	
+	XMLAttribute *bbElementFirstAttribute( XMLElement *element ){
+		return const_cast<XMLAttribute*>( element->FirstAttribute() );
+	}
+	
+	bbString bbElementGetText( XMLElement *element ){
+		return bbString::fromUtf8String( element->GetText() );
+	}
+
+	void bbDocumentDestroy( XMLDocument *doc ){
+		delete doc;
+	}
+}
+

+ 9 - 30
modules/tinyxml2/native/glue.h

@@ -8,44 +8,23 @@
 
 namespace tinyxml2{
 
-	bbString bbAttributeName( XMLAttribute *attribute ){
-		return bbString::fromUtf8String( attribute->Name() );
-	}
+	bbString bbAttributeName( XMLAttribute *attribute );
 	
-	bbString bbAttributeValue( XMLAttribute *attribute ){
-		return bbString::fromUtf8String( attribute->Value() );
-	}
+	bbString bbAttributeValue( XMLAttribute *attribute );
 	
-	XMLAttribute *bbAttributeNext( XMLAttribute *attribute ){
-		return const_cast<XMLAttribute*>( attribute->Next() );
-	}
+	XMLAttribute *bbAttributeNext( XMLAttribute *attribute );
 	
-	bbString bbNodeValue( XMLNode *node ){
-		return bbString::fromUtf8String( node->Value() );
-	}
+	bbString bbNodeValue( XMLNode *node );
 	
-	bbString bbElementName( XMLElement *element ){
-		return bbString::fromUtf8String( element->Name() );
-	}
+	bbString bbElementName( XMLElement *element );
 	
-	bbString bbElementAttribute( XMLElement *element,bbString name,bbString value ){
-		bbUtf8String cstr( value );
-		const char *p=0;
-		if( value.length() ) p=cstr;
-		return bbString::fromUtf8String( element->Attribute( bbUtf8String( name ),p ) );
-	}
+	bbString bbElementAttribute( XMLElement *element,bbString name,bbString value );
 	
-	XMLAttribute *bbElementFirstAttribute( XMLElement *element ){
-		return const_cast<XMLAttribute*>( element->FirstAttribute() );
-	}
+	XMLAttribute *bbElementFirstAttribute( XMLElement *element );
 	
-	bbString bbElementGetText( XMLElement *element ){
-		return bbString::fromUtf8String( element->GetText() );
-	}
+	bbString bbElementGetText( XMLElement *element );
 
-	void bbDocumentDestroy( XMLDocument *doc ){
-		delete doc;
-	}
+	void bbDocumentDestroy( XMLDocument *doc );
 }
 
 #endif

+ 1 - 0
modules/tinyxml2/tinyxml2.monkey2

@@ -3,6 +3,7 @@ Namespace tinyxml2
 
 #Import "native/tinyxml2.cpp"
 #Import "native/tinyxml2.h"
+#Import "native/glue.cpp"
 #Import "native/glue.h"
 
 Extern