xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
include
xrpl
json
include/xrpl/json/Output.h
1
#pragma once
2
3
#include <
functional
>
4
#include <
string
>
5
#include <
string_view
>
6
7
namespace
json
{
8
9
class
Value
;
10
11
using
Output
=
std::function
<void(
std::string_view
)>;
12
13
inline
Output
14
stringOutput
(
std::string
& s)
15
{
16
return
[&](
std::string_view
b) { s.
append
(b.data(), b.size()); };
17
}
18
25
void
26
outputJson
(
json::Value
const
&,
Output
const
&);
27
34
std::string
35
jsonAsString
(
json::Value
const
&);
36
37
}
// namespace json
std::string::append
T append(T... args)
std::string
std::string_view
json::Value
Represents a JSON value.
Definition
json_value.h:117
std::function
functional
json
JSON (JavaScript Object Notation).
Definition
json_errors.h:5
json::Output
std::function< void(std::string_view)> Output
Definition
include/xrpl/json/Output.h:11
json::outputJson
void outputJson(json::Value const &, Output const &)
Writes a minimal representation of a Json value to an Output in O(n) time.
Definition
libxrpl/json/Output.cpp:75
json::jsonAsString
std::string jsonAsString(json::Value const &)
Return the minimal string representation of a json::Value in O(n) time.
Definition
libxrpl/json/Output.cpp:82
json::stringOutput
Output stringOutput(std::string &s)
Definition
include/xrpl/json/Output.h:14
string
string_view
Generated by
1.17.0