Sfoglia il codice sorgente

WIP. syncing machines.

Lee Thomason 14 anni fa
parent
commit
857b868ca6
2 ha cambiato i file con 20 aggiunte e 0 eliminazioni
  1. 15 0
      tinyxml2.cpp
  2. 5 0
      tinyxml2.h

+ 15 - 0
tinyxml2.cpp

@@ -608,6 +608,15 @@ const char* StringStack::Pop() {
 
 XMLStreamer::XMLStreamer( FILE* file ) : fp( file ), depth( 0 ), elementJustOpened( false )
 {
+	for( int i=0; i<ENTITY_RANGE; ++i ) {
+		entityFlag[i] = false;
+	}
+	for( int i=0; i<NUM_ENTITIES; ++i ) {
+		TIXMLASSERT( entities[i].value < ENTITY_RANGE );
+		if ( entities[i].value < ENTITY_RANGE ) {
+			entityFlag[ entities[i].value ] = true;
+		}
+	}
 }
 
 
@@ -619,6 +628,12 @@ void XMLStreamer::PrintSpace( int depth )
 }
 
 
+void XMLStreamer::PrintString( const char* )
+{
+
+}
+
+
 void XMLStreamer::OpenElement( const char* name, bool textParent )
 {
 	if ( elementJustOpened ) {

+ 5 - 0
tinyxml2.h

@@ -295,10 +295,15 @@ public:
 private:
 	void SealElement();
 	void PrintSpace( int depth );
+	void PrintString( const char* );	// prints out, after detecting entities.
 
 	FILE* fp;
 	int depth;
 	bool elementJustOpened;
+	enum {
+		ENTITY_RANGE = 64,
+	};
+	bool entityFlag[ENTITY_RANGE];
 
 	StringStack stack;
 	StringStack text;