|
Ditto
1.0.12
|
Provides an interface to specify a path to a key in a document that you can then call a function on to get the value at the specified key as a specific type. More...
Public Member Functions | |
| DocumentPath | operator[] (std::string key) |
| DocumentPath | operator[] (std::size_t index) |
| std::string | get_string_value () |
Returns the value at the previously specified key in the document as a std::string. If the key was invalid a default value of an empty string will be returned. More... | |
| int | get_int_value () |
Returns the value at the previously specified key in the document as an int. If the key was invalid a default value of 0 will be returned. More... | |
| double | get_double_value () |
Returns the value at the previously specified key in the document as a double. If the key was invalid a default value of 0 will be returned. More... | |
| float | get_float_value () |
Returns the value at the previously specified key in the document as a float. If the key was invalid a default value of 0 will be returned. More... | |
| bool | get_bool_value () |
Returns the value at the previously specified key in the document as a bool. If the key was invalid a default value of false will be returned. More... | |
| nlohmann::json | get_json () |
Returns the value at the previously specified key in the document as a nlohmann::json object. If the key was invalid the return value will be a nullptr. More... | |
| std::shared_ptr< AttachmentToken > | get_attachment_token () |
Returns the value at the previously specified key in the document as a std::shared_ptr<AttachmentToken>. If the key was invalid the return value will be a nullptr. More... | |
Provides an interface to specify a path to a key in a document that you can then call a function on to get the value at the specified key as a specific type.
You obtain a DocumentPath by subscripting a Document and you can then further subscript a DocumentPath to further specify the key of the document that you want to get the value of.
| std::shared_ptr< AttachmentToken > ditto::DocumentPath::get_attachment_token | ( | ) |
Returns the value at the previously specified key in the document as a std::shared_ptr<AttachmentToken>. If the key was invalid the return value will be a nullptr.
std::shared_ptr<AttachmentToken>. The return value will be a nullptr if the key was invalid or the value was not an AttachmentToken object. | bool ditto::DocumentPath::get_bool_value | ( | ) |
Returns the value at the previously specified key in the document as a bool. If the key was invalid a default value of false will be returned.
bool. The return value will be false if the key was invalid or the value was not a boolean type. | double ditto::DocumentPath::get_double_value | ( | ) |
Returns the value at the previously specified key in the document as a double. If the key was invalid a default value of 0 will be returned.
double. The return value will be 0 if the key was invalid or the value was not a numeric type. | float ditto::DocumentPath::get_float_value | ( | ) |
Returns the value at the previously specified key in the document as a float. If the key was invalid a default value of 0 will be returned.
float. The return value will be 0 if the key was invalid or the value was not a numeric type. | int ditto::DocumentPath::get_int_value | ( | ) |
Returns the value at the previously specified key in the document as an int. If the key was invalid a default value of 0 will be returned.
int. The return value will be 0 if the key was invalid or the value was not a numeric type. | json ditto::DocumentPath::get_json | ( | ) |
Returns the value at the previously specified key in the document as a nlohmann::json object. If the key was invalid the return value will be a nullptr.
nlohmann::json object. The return value will be a nullptr if the key was invalid. | std::string ditto::DocumentPath::get_string_value | ( | ) |
Returns the value at the previously specified key in the document as a std::string. If the key was invalid a default value of an empty string will be returned.
std::string. The return value will be an empty string if the key was invalid or the value was not a string.