rippled
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 ripple {
9
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 ripple
Represents a JSON value.
Definition json_value.h:131
bool isArray() const
bool isString() const
bool isObject() const
std::string asString() const
Returns the unquoted string value.
void write(PropertyStream &stream)
write this source and all its children recursively to the stream.
A PropertyStream::Sink which produces a Json::Value of type objectValue.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Json::Value doPrint(RPC::JsonContext &)
Definition Print.cpp:11
Application & app
Definition Context.h:22