From e54136d74cb4e3b6ed6fdd9d618e3516a0220bf5 Mon Sep 17 00:00:00 2001 From: Drew Noakes Date: Mon, 2 Feb 2015 10:05:31 +0000 Subject: [PATCH] Add std::string overload to PrettyWriter when RAPIDJSON_HAS_STDSTRING defined. --- include/rapidjson/prettywriter.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/rapidjson/prettywriter.h b/include/rapidjson/prettywriter.h index ca62bb7..9109f6d 100644 --- a/include/rapidjson/prettywriter.h +++ b/include/rapidjson/prettywriter.h @@ -82,6 +82,12 @@ public: return Base::WriteString(str, length); } +#if RAPIDJSON_HAS_STDSTRING + bool String(const std::basic_string& str) { + return String(str.data(), SizeType(str.size())); + } +#endif + bool StartObject() { PrettyPrefix(kObjectType); new (Base::level_stack_.template Push()) typename Base::Level(false);