CernVM-FS
2.12.0
|
#include <json_document_write.h>
Classes | |
struct | JsonEntry |
Public Member Functions | |
void | Add (const std::string &key, const std::string &val) |
void | Add (const std::string &key, const int val) |
void | Add (const std::string &key, const float val) |
void | Add (const std::string &key, const int64_t val) |
void | AddJsonObject (const std::string &key, const std::string &json) |
std::string | GenerateString () const |
void | Clear () |
Private Types | |
enum | JsonVariant { kString, kInteger, kFloat, kJsonObject } |
Private Member Functions | |
const std::string | Escape (const std::string &input) const |
Private Attributes | |
std::vector< JsonEntry > | entries |
This file is part of the CernVM File System. This class is used for marshalling JSON objects to strings.
When creating simple objects is sufficient to call the Add()
methods to add new key - values to the final JSON.
When creating complex objects, (an object that contains another object) is necessary to create first the nested object and then add it to the final object with the AddJsonObject
. This will take care of all the escaping.
Definition at line 29 of file json_document_write.h.
|
private |
Enumerator | |
---|---|
kString | |
kInteger | |
kFloat | |
kJsonObject |
Definition at line 30 of file json_document_write.h.
|
inline |
Definition at line 92 of file json_document_write.h.
Referenced by upload::SessionContext::Commit(), receiver::Reactor::HandleCheckToken(), receiver::Reactor::HandleCommit(), receiver::Reactor::HandleGenerateToken(), receiver::Reactor::HandleGetTokenId(), receiver::Reactor::HandleRequest(), receiver::Reactor::HandleSubmitPayload(), and perf::Statistics::PrintJSON().
|
inline |
Definition at line 97 of file json_document_write.h.
|
inline |
Definition at line 102 of file json_document_write.h.
|
inline |
Definition at line 107 of file json_document_write.h.
|
inline |
Definition at line 112 of file json_document_write.h.
Referenced by receiver::Reactor::HandleSubmitPayload(), and perf::Statistics::PrintJSON().
|
inline |
Definition at line 132 of file json_document_write.h.
Referenced by perf::Statistics::PrintJSON().
|
inlineprivate |
Definition at line 141 of file json_document_write.h.
|
inline |
Definition at line 118 of file json_document_write.h.
Referenced by upload::SessionContext::Commit(), receiver::Reactor::HandleCheckToken(), receiver::Reactor::HandleCommit(), receiver::Reactor::HandleGenerateToken(), receiver::Reactor::HandleGetTokenId(), receiver::Reactor::HandleRequest(), receiver::Reactor::HandleSubmitPayload(), and perf::Statistics::PrintJSON().
|
private |
Definition at line 175 of file json_document_write.h.