xrpld
Loading...
Searching...
No Matches
Print.cpp
1#include <xrpld/app/main/Application.h>
2#include <xrpld/rpc/Context.h>
3
4#include <xrpl/json/JsonPropertyStream.h>
5#include <xrpl/json/json_value.h>
6#include <xrpl/protocol/jss.h>
7
8namespace xrpl {
9
10json::Value
12{
13 JsonPropertyStream stream;
14 if (context.params.isObject() && context.params[jss::params].isArray() &&
15 context.params[jss::params][0u].isString())
16 {
17 context.app.write(stream, context.params[jss::params][0u].asString());
18 }
19 else
20 {
21 context.app.write(stream);
22 }
23
24 return stream.top();
25}
26
27} // namespace xrpl
void write(PropertyStream &stream)
write this source and all its children recursively to the stream.
bool isObject() const
bool isArray() const
bool isString() const
std::string asString() const
Returns the unquoted string value.
A PropertyStream::Sink which produces a json::Value of type ValueType::Object.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
json::Value doPrint(RPC::JsonContext &context)
Definition Print.cpp:11
Application & app
Definition Context.h:21
json::Value params
Definition Context.h:43