|
MarkLogic Connect
MarkLogic Connect Client API Collection
|
This class represents the internal content of a Document. It can be XML, JSON, String or Binary (or a sub type thereof). More...
#include <DocumentContent.hpp>
Public Member Functions | |
| MLCLIENT_API | IDocumentContent () |
| virtual MLCLIENT_API | ~IDocumentContent ()=0 |
| virtual MLCLIENT_API std::istream * | getStream () const =0 |
| Returns the content of this IDocumentContent as an istream. More... | |
| virtual MLCLIENT_API std::string | getContent () const =0 |
| Returns the content of this IDocumentContent as a std::string. More... | |
| virtual MLCLIENT_API std::string | getMimeType () const =0 |
| Returns the MIME type of this content. More... | |
| virtual MLCLIENT_API void | setMimeType (const std::string &mt)=0 |
| Sets the MIME type of this content. More... | |
Static Public Attributes | |
| static MLCLIENT_API const std::string | MIME_JSON |
| static MLCLIENT_API const std::string | MIME_XML |
This class represents the internal content of a Document. It can be XML, JSON, String or Binary (or a sub type thereof).
This class can also be used to wrap search options and other JSON/XML based content. There are only two specialisations of this class - text and binary - all more complex types are created by using the CppRestJsonHelper and PugiXmlHelper to parse/create these types. E.g. a pugixml::document or web::json::value.
| MLCLIENT_API mlclient::IDocumentContent::IDocumentContent | ( | ) |
The IDocumentContent constructor. Called implicitly by subclasses only.
|
pure virtual |
A virtual destructor, ripe for overloading. REQUIRED to allow subclassing
|
pure virtual |
Returns the content of this IDocumentContent as a std::string.
This allows streaming of a HTTP request, with data encoded as a string.
Implemented in mlclient::FileDocumentContent, mlclient::GenericTextDocumentContent, mlclient::utilities::PugiXmlDocumentContent, and mlclient::utilities::CppRestJsonDocumentContent.
|
pure virtual |
Returns the MIME type of this content.
E.g. application/json or application/xml
Implemented in mlclient::FileDocumentContent, mlclient::GenericTextDocumentContent, mlclient::utilities::PugiXmlDocumentContent, and mlclient::utilities::CppRestJsonDocumentContent.
|
pure virtual |
Returns the content of this IDocumentContent as an istream.
This allows streaming to a HTTP request, and works for binary and string content.
Implemented in mlclient::FileDocumentContent, mlclient::GenericTextDocumentContent, mlclient::utilities::PugiXmlDocumentContent, and mlclient::utilities::CppRestJsonDocumentContent.
|
pure virtual |
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) |
Implemented in mlclient::FileDocumentContent, mlclient::GenericTextDocumentContent, mlclient::utilities::PugiXmlDocumentContent, and mlclient::utilities::CppRestJsonDocumentContent.
1.8.10