MarkLogic Connect
MarkLogic Connect Client API Collection
|
This class is a specialisation of ITextDocumentContent (and thus IDocumentContent) that holds all data in a string. More...
#include <DocumentContent.hpp>
Public Member Functions | |
MLCLIENT_API | GenericTextDocumentContent () |
Constructs a blank text document. More... | |
MLCLIENT_API | GenericTextDocumentContent (const GenericTextDocumentContent &doc) |
deep copy constructor | |
MLCLIENT_API | GenericTextDocumentContent (const ITextDocumentContent &doc) |
deep copy constructor | |
virtual MLCLIENT_API | ~GenericTextDocumentContent () |
Pure virtual destructor. | |
MLCLIENT_API void | setContent (std::string content) override |
Sets the textual content for this document. More... | |
MLCLIENT_API std::istream * | getStream () const override |
Returns the content of this TextDocumentContent as an istream. More... | |
MLCLIENT_API std::string | getContent () const override |
Returns the content as a string. More... | |
MLCLIENT_API std::string | getMimeType () const override |
Returns the MIME type of this content. More... | |
MLCLIENT_API void | setMimeType (const std::string &mt) override |
Sets the MIME type of this content. More... | |
MLCLIENT_API int | getLength () const override |
Returns the number of characters in the content string. More... | |
MLCLIENT_API IDocumentNavigator * | navigate (bool firstElementAsRoot=false) const override |
Returns a way to navigate the document. More... | |
![]() | |
MLCLIENT_API | IDocumentContent () |
virtual MLCLIENT_API | ~IDocumentContent ()=0 |
Additional Inherited Members | |
![]() | |
static MLCLIENT_API const std::string | MIME_JSON |
static MLCLIENT_API const std::string | MIME_XML |
This class is a specialisation of ITextDocumentContent (and thus IDocumentContent) that holds all data in a string.
This class is used as the data holding class for all JSON and XML documents. There are no JSON or XML specialisations (Use the JSON and XML helper classes in the utilities namespace instead to create, modify, or introspect the JSON/XML.)
MLCLIENT_API mlclient::GenericTextDocumentContent::GenericTextDocumentContent | ( | ) |
Constructs a blank text document.
The type will by default be set to JSON. Content will by default be an empty string.
|
overridevirtual |
Returns the content as a string.
Implements mlclient::IDocumentContent.
|
overridevirtual |
Returns the number of characters in the content string.
Implements mlclient::ITextDocumentContent.
|
overridevirtual |
Returns the MIME type of this content.
E.g. application/json or application/xml
Implements mlclient::IDocumentContent.
|
overridevirtual |
Returns the content of this TextDocumentContent as an istream.
This allows streaming to a HTTP request of this string content.
Implements mlclient::IDocumentContent.
|
overridevirtual |
Returns a way to navigate the document.
Implements mlclient::ITextDocumentContent.
|
overridevirtual |
Sets the textual content for this document.
Assumes content string is non null
[in] | The | string content to copy in to this object. |
Implements mlclient::ITextDocumentContent.
|
overridevirtual |
Sets the MIME type of this content.
E.g. application/json or application/xml
[in] | mt | The mimetype string, not including encoding, for this Document Content. Assume always UTF-8 for MarkLogic Server) |
Implements mlclient::IDocumentContent.