Răsfoiți Sursa

renamed function, added test case

Lee Thomason (grinliz) 13 ani în urmă
părinte
comite
48ea0bcf80
2 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 4 2
      tinyxml2.h
  2. 1 0
      xmltest.cpp

+ 4 - 2
tinyxml2.h

@@ -1372,9 +1372,11 @@ public:
 	*/
 	const char* CStr() const { return buffer.Mem(); }
 	/**
-   		Return the size of the XML file in memory
+   		If in print to memory mode, return the size 
+		of the XML file in memory. (Note the size returned
+		includes the terminating null.)
   	*/
-  	const int SizeOfCStr()const{ return buffer.Size(); }
+  	const int CStrSize()const{ return buffer.Size(); }
 
 private:
 	void SealElement();

+ 1 - 0
xmltest.cpp

@@ -824,6 +824,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
 
 		static const char* result  = "\xef\xbb\xbf<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
 		XMLTest( "BOM and default declaration", printer.CStr(), result, false );
+		XMLTest( "CStrSize", printer.CStrSize(), 42, false );
 	}