rippled
Loading...
Searching...
No Matches
include/xrpl/json/Output.h
1#ifndef XRPL_JSON_OUTPUT_H_INCLUDED
2#define XRPL_JSON_OUTPUT_H_INCLUDED
3
4#include <boost/beast/core/string.hpp>
5
6#include <functional>
7#include <string>
8
9namespace Json {
10
11class Value;
12
13using Output = std::function<void(boost::beast::string_view const&)>;
14
15inline Output
17{
18 return [&](boost::beast::string_view const& b) {
19 s.append(b.data(), b.size());
20 };
21}
22
28void
29outputJson(Json::Value const&, Output const&);
30
38
39} // namespace Json
40
41#endif
T append(T... args)
Represents a JSON value.
Definition json_value.h:130
JSON (JavaScript Object Notation).
Definition json_errors.h:6
Output stringOutput(std::string &s)
std::string jsonAsString(Json::Value const &)
Return the minimal string representation of a Json::Value in O(n) time.
std::function< void(boost::beast::string_view const &)> Output
void outputJson(Json::Value const &, Output const &)
Writes a minimal representation of a Json value to an Output in O(n) time.