@ -313,12 +313,8 @@ public:
template < class Stream >
void SerializeTableMulti ( Stream & out , bool use_indents , int level ) const ;
template < class Stream >
static void PrintValue ( Stream & out , const std : : wstring & str , bool use_quote = true ) ;
// for other uses
template < class Stream >
static void PrintValue ( Stream & out , const std : : string & str , bool use_quote = true ) ;
template < class Stream , class StringType >
static void PrintValue ( Stream & out , const StringType & str , bool use_quote = true ) ;
template < class Stream >
static void PrintKey ( Stream & out , const std : : wstring & str ) ;
@ -361,61 +357,28 @@ void Space::PrintLevel(Stream & out, bool use_indents, int level)
template < class Stream >
void Space : : PrintValue ( Stream & out , const std : : wstring & str , bool use_quote )
{
if ( use_quote )
out < < ' \" ' ;
for ( size_t i = 0 ; i < str . size ( ) ; + + i )
{
if ( str [ i ] = = ' \\ ' )
out < < L " \\ \\ " ;
else
if ( str [ i ] = = ' " ' )
out < < L " \\ \" " ;
else
if ( str [ i ] = = ' \r ' )
out < < L " \\ r " ;
else
if ( str [ i ] = = ' \n ' )
out < < L " \\ n " ;
else
if ( str [ i ] = = 0 )
out < < L " \\ 0 " ;
else
out < < str [ i ] ;
}
if ( use_quote )
out < < ' \" ' ;
}
template < class Stream >
void Space : : PrintValue ( Stream & out , const std: : string & str , bool use_quote )
template < class Stream , class StringType >
void Space : : PrintValue ( Stream & out , const StringType & str , bool use_quote )
{
if ( use_quote )
out < < ' \" ' ;
for ( size_t i = 0 ; i < str . size ( ) ; + + i )
{
if ( str [ i ] = = ' \\ ' )
out < < " \\ \\ " ;
else
if ( str [ i ] = = ' " ' )
out < < " \\ \" " ;
else
if ( str [ i ] = = ' \r ' )
out < < " \\ r " ;
else
if ( str [ i ] = = ' \n ' )
out < < " \\ n " ;
else
if ( str [ i ] = = 0 )
out < < " \\ 0 " ;
else
switch ( str [ i ] )
{
case 0 : out < < ' \\ ' ; out < < ' 0 ' ; break ;
case ' \r ' : out < < ' \\ ' ; out < < ' r ' ; break ;
case ' \n ' : out < < ' \\ ' ; out < < ' n ' ; break ;
case ' \\ ' : out < < ' \\ ' ; out < < ' \\ ' ; break ;
case ' " ' : out < < ' \\ ' ; out < < ' \" ' ; break ;
case ' ( ' : out < < ' \\ ' ; out < < ' ( ' ; break ;
case ' ) ' : out < < ' \\ ' ; out < < ' ) ' ; break ;
case ' = ' : out < < ' \\ ' ; out < < ' = ' ; break ;
default :
out < < str [ i ] ;
}
}
if ( use_quote )