MarkLogic Connect
MarkLogic Connect Client API Collection
|
This class provides utility functions to handle JSON data. More...
#include <CppRestJsonHelper.hpp>
Static Public Member Functions | |
cpprestjsonhelper_documentconversion IDocumentContent conversion functions | |
static MLCLIENT_API ITextDocumentContent * | toDocument (web::json::value &json) |
Creates a IDocumentContent instance based on a cpprest API web::json::value instance. More... | |
static MLCLIENT_API ITextDocumentContent * | toDocument (const Response &resp) |
Converts the Response directory to an ITextDocumentContent instance. More... | |
static MLCLIENT_API const web::json::value | fromDocument (const IDocumentContent &doc) |
Creates a web::json::value from a IDocumentContent instance. More... | |
static MLCLIENT_API const web::json::value | fromDocument (const CppRestJsonDocumentContent &doc) |
Creates a web::json::value from a CppRestJsonDocumentContent instance. More... | |
cpprestjsonhelper_responseconversion Response conversion functions | |
static MLCLIENT_API web::json::value | fromResponse (const Response &resp) |
Creates a web::json::value from a Response object. More... | |
static MLCLIENT_API PermissionSet | permissionsFromResponse (const Response &resp) |
Extracts a PermissionSet from a document metadata fetch response. More... | |
This class provides utility functions to handle JSON data.
This is a non-instantiable class with static functions to handle conversion of data between raw cpprest web::json::value and IDocumentContent objects.
The fromResponse and toDocument functions are particularly useful when extracting information from a Response object.
This class uses the CppRestJsonDocumentContent instance to directly wrap an underlying web::json::value instance.
|
static |
Creates a web::json::value from a IDocumentContent instance.
An | InvalidFormatException if the document does not have the mime type of application/json, or if there is a parse error. |
doc | The IDocumentContent instance to create a web::json::value from. |
|
static |
Creates a web::json::value from a CppRestJsonDocumentContent instance.
This is very efficient as the CppRestJsonDocumentContent effectively just wraps a web::json::value
doc | the CppRestJsonDocumentContent instance to extract the web::json::value from |
|
static |
Creates a web::json::value from a Response object.
An | InvalidFormatException if the document does not have the mime type of application/json, or if there is a parse error. |
resp | The Response instance to create a web::json::value from. |
|
static |
Extracts a PermissionSet from a document metadata fetch response.
An | InvalidFormatException if the document does not have the mime type of application/json, or if there is a parse error. |
resp | The Response instance to create a web::json::value from. |
|
static |
Creates a IDocumentContent instance based on a cpprest API web::json::value instance.
json | The web::json::value to create a IDocumentContent representation of |
|
static |
Converts the Response directory to an ITextDocumentContent instance.
resp | The Response instance to create a web::json::value from. |