From: Baptiste L. <bl...@us...> - 2005-07-27 22:28:18
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27056/src/lib_json Modified Files: json_writer.cpp Log Message: * added FastWriter implementation and updated test (read the written input and check if correct). Index: json_writer.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** json_writer.cpp 27 Jul 2005 07:09:23 -0000 1.1.1.1 --- json_writer.cpp 27 Jul 2005 22:28:08 -0000 1.2 *************** *** 1,4 **** #include <json/json_writer.h> - #include <algorithm> #include <utility> #include <assert.h> --- 1,3 ---- *************** *** 8,12 **** static void uintToString( unsigned int value, ! char *current ) { *--current = 0; --- 7,11 ---- static void uintToString( unsigned int value, ! char *¤t ) { *--current = 0; *************** *** 18,22 **** } while ( value != 0 ); - std::reverse( current, end ); } --- 17,20 ---- *************** *** 104,108 **** --- 102,110 ---- int size = value.size(); for ( int index =0; index < size; ++index ) + { + if ( index > 0 ) + document_ += ", "; writeValue( value[index] ); + } document_ += " ]"; } *************** *** 119,123 **** if ( it != members.begin() ) document_ += ", "; ! document_ += name; document_ += " : "; writeValue( value[name] ); --- 121,125 ---- if ( it != members.begin() ) document_ += ", "; ! document_ += valueToQuotedString( name.c_str() ); document_ += " : "; writeValue( value[name] ); |