From 436119268da41d45f95e3cf3e4a2954f114d6891 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 11 Aug 2016 14:08:49 -0400 Subject: add convenience function ll_stream_notation_sd for compact representation of llsd --- indra/llcommon/llsdutil.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/llcommon/llsdutil.cpp') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 6ad4a97149..8ccd915e6d 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -193,6 +193,17 @@ char* ll_pretty_print_sd(const LLSD& sd) return buffer; } +std::string ll_stream_notation_sd(const LLSD& sd) +{ + std::ostringstream stream; + //stream.rdbuf()->pubsetbuf(buffer, bufferSize); + stream << LLSDOStreamer(sd); + stream << std::ends; + + return stream.str(); +} + + //compares the structure of an LLSD to a template LLSD and stores the //"valid" values in a 3rd LLSD. Default values pulled from the template //if the tested LLSD does not contain the key/value pair. -- cgit v1.2.3 From 8dff769dc9d899d884b926cd552bdff5e132d73b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 9 Mar 2017 11:32:06 -0500 Subject: do not insert a null char into the std::string when serializing llsd notation --- indra/llcommon/llsdutil.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llcommon/llsdutil.cpp') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 8ccd915e6d..9d00395c0a 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -196,10 +196,7 @@ char* ll_pretty_print_sd(const LLSD& sd) std::string ll_stream_notation_sd(const LLSD& sd) { std::ostringstream stream; - //stream.rdbuf()->pubsetbuf(buffer, bufferSize); stream << LLSDOStreamer(sd); - stream << std::ends; - return stream.str(); } -- cgit v1.2.3