From 11ddf0f6d94acbbeed7a382329d23b96c97dbddf Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Sat, 12 May 2012 15:54:20 +0000 Subject: [PATCH] fixed: in Space serializer: we have to escape more characters fixed: in SpaceParser::ReadTokenSingle the delimiter can be only if the character was not escaped git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@409 e52654a7-88a9-db11-a3e9-0013d4bc506e --- space/space.h | 71 +++++++++++-------------------------------- space/spaceparser.cpp | 19 +++++++----- 2 files changed, 28 insertions(+), 62 deletions(-) diff --git a/space/space.h b/space/space.h index 3dae1dd..b18a21d 100755 --- a/space/space.h +++ b/space/space.h @@ -313,12 +313,8 @@ public: template void SerializeTableMulti(Stream & out, bool use_indents, int level) const; - template - static void PrintValue(Stream & out, const std::wstring & str, bool use_quote = true); - - // for other uses - template - static void PrintValue(Stream & out, const std::string & str, bool use_quote = true); + template + static void PrintValue(Stream & out, const StringType & str, bool use_quote = true); template static void PrintKey(Stream & out, const std::wstring & str); @@ -361,61 +357,28 @@ void Space::PrintLevel(Stream & out, bool use_indents, int level) -template -void Space::PrintValue(Stream & out, const std::wstring & str, bool use_quote) + +template +void Space::PrintValue(Stream & out, const StringType & str, bool use_quote) { if( use_quote ) out << '\"'; for(size_t i=0 ; i -void Space::PrintValue(Stream & out, const std::string & str, bool use_quote) -{ - if( use_quote ) - out << '\"'; - - for(size_t i=0 ; i