MarkLogic Connect
MarkLogic Connect Client API Collection
Static Public Member Functions | List of all members
mlclient::utilities::DocumentHelper Class Reference

Helper methods to work with Document and IDocumentContent instances. More...

#include <DocumentHelper.hpp>

Static Public Member Functions

static DocumentfromResponse (const Response &resp)
 A very, very simple function to take the content from a response and wrap in a Document object. More...
 
static void fromResponse (const Response &resp, Document &doc)
 A very, very simple function to take the content from a response and wrap in a Document object. More...
 
static IDocumentContentcontentFromResponse (const Response &resp)
 Returns an IDocumentContent* instance from a response. Retrieves content only, and only for a single document. More...
 

Detailed Description

Helper methods to work with Document and IDocumentContent instances.

Since
8.0.2
Date
2016-08-09

Member Function Documentation

static IDocumentContent* mlclient::utilities::DocumentHelper::contentFromResponse ( const Response resp)
static

Returns an IDocumentContent* instance from a response. Retrieves content only, and only for a single document.

Exceptions
InvalidFormatExceptionif the Response does not have a mime type of application/xml or application/json or plain/text, or if a parsing error occurs.
Parameters
respThe MarkLogic C++ API Response object instance.
Returns
An IDocumentContent* instance created from the Response.
static Document* mlclient::utilities::DocumentHelper::fromResponse ( const Response resp)
static

A very, very simple function to take the content from a response and wrap in a Document object.

Note
You should normally use contentFromResponse(resp) only. This function ONLY returns the content wrapped as a document for convenience. More sophisticated methods in the Connection class handle all fields and multi-part responses.
Exceptions
InvalidFormatExceptionif the Response does not have a mime type of application/xml or application/json or plain/text, or if a parsing error occurs.
Parameters
respThe MarkLogic C++ API Response object instance.
Returns
An IDocumentContent* instance created from the Response.
static void mlclient::utilities::DocumentHelper::fromResponse ( const Response resp,
Document doc 
)
static

A very, very simple function to take the content from a response and wrap in a Document object.

Note
You should normally use contentFromResponse(resp) only. This function ONLY returns the content wrapped as a document for convenience. More sophisticated methods in the Connection class handle all fields and multi-part responses.
Exceptions
InvalidFormatExceptionif the Response does not have a mime type of application/xml or application/json or plain/text, or if a parsing error occurs.
Parameters
respThe MarkLogic C++ API Response object instance.
docAn IDocumentContent instance to populate from the Response.

The documentation for this class was generated from the following file: