From 4cfffdf76f27efe61d44afb950861f9dd7d778fd Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 31 May 2015 16:10:44 -0700 Subject: [PATCH] Add pretty(Json::Value) --- src/ripple/json/impl/to_string.cpp | 5 +++++ src/ripple/json/to_string.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/ripple/json/impl/to_string.cpp b/src/ripple/json/impl/to_string.cpp index f610a06b1..6182f4b7d 100644 --- a/src/ripple/json/impl/to_string.cpp +++ b/src/ripple/json/impl/to_string.cpp @@ -29,4 +29,9 @@ std::string to_string (Value const& value) return FastWriter ().write (value); } +std::string pretty (Value const& value) +{ + return StyledWriter().write (value); +} + } // namespace Json diff --git a/src/ripple/json/to_string.h b/src/ripple/json/to_string.h index 04834df1e..cf093e212 100644 --- a/src/ripple/json/to_string.h +++ b/src/ripple/json/to_string.h @@ -30,6 +30,9 @@ class Value; /** Writes a Json::Value to an std::string. */ std::string to_string (Value const&); +/** Writes a Json::Value to an std::string. */ +std::string pretty (Value const&); + /** Output using the StyledStreamWriter. @see Json::operator>>(). */ std::ostream& operator<< (std::ostream&, const Value& root);