MarkLogic Connect
MarkLogic Connect Client API Collection
Namespaces | Classes | Typedefs | Enumerations | Functions
mlclient Namespace Reference

the namespace which wraps all Core Public C++ API classes. More...

Namespaces

 utilities
 A non-required utilities namespace. Be aware that classes in this namespace may have external dependencies. These are documented in the class documentation.
 

Classes

class  Connection
 Provides a high level logical object representing all access to a single MarkLogic database. More...
 
class  Document
 Provides a representation of a MarkLogic Document. More...
 
class  FileDocumentContent
 Wraps a file system file ready for its upload to MarkLogic Server. More...
 
class  GenericTextDocumentContent
 This class is a specialisation of ITextDocumentContent (and thus IDocumentContent) that holds all data in a string. More...
 
class  HttpHeaders
 
class  IConnection
 Provides a virtual only interface for a connection. Allows the creation of a FakeConnection subclass, or a real Connection subclass. More...
 
class  IDocumentContent
 This class represents the internal content of a Document. It can be XML, JSON, String or Binary (or a sub type thereof). More...
 
class  IDocumentNavigator
 Acts as a generic lightweight document interface. More...
 
class  IDocumentNode
 Acts as a generic lightweight document element interface. More...
 
class  InvalidFormatException
 Indicates an issue with parsing content. More...
 
class  ITextDocumentContent
 An overarching interface for a Text Document. More...
 
struct  LoggingConfiguration
 LoggingConfiguration to use. More...
 
class  NoCredentialsException
 Indicates that you have not provided the Connection with any credentials, or the credentials are invalid. More...
 
class  Permission
 Represents a single MarkLogic Permission. More...
 
class  Response
 Encapsulates a response from a MarkLogic server REST API. More...
 
class  SearchDescription
 A POD class representing input to the POST of /v1/search - i.e. all search configuration. More...
 
class  SearchResult
 Represents a single search result. Wraps all REST API search result metadata and content. More...
 
class  SearchResultSet
 A self-advancing result set class. More...
 
class  SearchResultSetIterator
 An STL compatible Iterator implementation. More...
 
class  ValuesIterator
 Provides an STL compliant iterator implementation over a ValuesResultSet. More...
 
class  ValuesResult
 Contains details of the overarching /v1/values (i.e. Connection::values) call results. More...
 
struct  ValuesResultAggregate
 Represents a single aggregate result from a values lookup. More...
 
class  ValuesResultSet
 Provides support for multiple values result lookups in a single hit. More...
 
struct  ValuesResultValue
 Represents a single values lexicon result from a values lookup. More...
 

Typedefs

typedef std::string Collection
 Typedef for a Collection as a string. More...
 
typedef std::vector< CollectionCollectionSet
 Represents a set of Collection object instances. More...
 
typedef std::vector< Collection >::const_iterator CollectionIterator
 Provides an Iterator over a set of Collection instances. More...
 
typedef std::string DocumentUri
 Typedef for a Document URI as a string. More...
 
typedef std::vector< DocumentUriDocumentUriSet
 Represents a set of DocumentUri object instances. More...
 
typedef std::vector< DocumentUri >::const_iterator DocumentUriIterator
 Provides an Iterator over a set of DocumentUri instances. More...
 
typedef std::vector< DocumentDocumentSet
 Represents a set of Document object instances. More...
 
typedef std::vector< Document >::const_iterator DocumentIterator
 Provides an Iterator over a set of document instances. More...
 
typedef std::vector< PermissionPermissionSet
 Represents a set of Permission object instances. More...
 
typedef std::vector< Permission >::const_iterator PermissionIterator
 Provides an Iterator over a set of Permission instances. More...
 

Enumerations

enum  BinaryEncoding : int { HEX = 1, BIN = 2 }
 An enumeration for use with the BinaryDocumentContent class. More...
 
enum  Capability { EXECUTE, INSERT, READ, UPDATE }
 A capability associated with a (Document) permission in MarkLogic Server.
 
enum  ResponseType : int {
  UNKNOWN_TYPE = 0, XML = 1, JSON = 2, TEXT = 3,
  BINARY = 4
}
 The MarkLogic response type - Unknown (means the API hasn't been told by your own function calls!), XML, JSON, plain TEXT or BINARY.
 
enum  ResponseCode : int {
  UNKNOWN_CODE = 0, CONTINUE = 100, OK = 200, CREATED = 201,
  ACCEPTED = 202, NO_CONTENT = 204, RESET_CONTENT = 205, PARTIAL_CONTENT = 206,
  MULTIPLE_CHOICES = 300, MOVED_PERMANENTLY = 301, FOUND = 302, SEE_OTHER = 303,
  NOT_MODIFIED = 304, USE_PROXY = 305, TEMPORARY_REDIRECT = 307, BAD_REQUEST = 400,
  UNAUTHORIZED = 401, PAYMENT_REQUIRED = 402, FORBIDDEN = 403, NOT_FOUND = 404,
  METHOD_NOT_ALLOWED = 405, NOT_ACCEPTABLE = 406, PROXY_AUTHENTICATION_REQUIRED = 407, REQUEST_TIMEOUT = 408,
  CONFLICT = 409, GONE = 410, LENGTH_REQUIRED = 411, PRECONDITION_FAILED = 412,
  REQUEST_ENTITY_TOO_LARGE = 413, REQUEST_URI_TOO_LONG = 414, UNSUPPORTED_MEDIA_TYPE = 415, REQUEST_RANGE_BAD = 416,
  EXPECTATION_FAILED = 417, INTERNAL_SERVER_ERROR = 500, NOT_IMPLEMENTED = 501, BAD_GATEWAY = 502,
  SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504, HTTP_VERSION_NOT_SUPPORTED = 505
}
 The various HTTP response codes. Defaults to UNKNOWN to prevent API failures.
 
enum  Format {
  JSON, XML, BINARY, NONE,
  TEXT
}
 
enum  ValuesResultAggregateType { SIMPLE_DOUBLE, COMPLEX_MAP_ARRAY }
 Represents the type of response received from the aggregate. More...
 

Functions

template<class T , class... Types>
std::unique_ptr< T > make_unique (Types &&...Args)
 
void libraryLoggingInit ()
 
MLCLIENT_API void reconfigureLogging (int argc, const char *argv[])
 Reconfigure logging from command line args. More...
 
MLCLIENT_API void reconfigureLoggingSettings (const LoggingConfiguration &config)
 Reconfigures logging from a LoggingConfiguration struct. More...
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&...args)
 
MLCLIENT_API std::ostream & operator<< (std::ostream &os, const Capability &rt)
 
MLCLIENT_API std::string & operator+ (std::string &s, const Capability &rt)
 
MLCLIENT_API const std::string translate_capability (const Capability &rt)
 
MLCLIENT_API Capability toCapability (const std::string &capString)
 
MLCLIENT_API std::ostream & operator<< (std::ostream &os, const Permission &rt)
 
MLCLIENT_API std::string & operator+ (std::string &s, const Permission &rt)
 
MLCLIENT_API const std::string translate_permission (const Permission &rt)
 
MLCLIENT_API std::ostream & operator<< (std::ostream &os, const ResponseType &rt)
 
MLCLIENT_API std::string & operator+ (std::string &s, const ResponseType &rt)
 
MLCLIENT_API const std::string translate_responsetype (const ResponseType &rt)
 
MLCLIENT_API std::ostream & operator<< (std::ostream &os, const ResponseCode &rc)
 
MLCLIENT_API std::string & operator+ (std::string &s, const ResponseCode &rc)
 
MLCLIENT_API const std::string translate_responsecode (const ResponseCode &rt)
 

Detailed Description

the namespace which wraps all Core Public C++ API classes.

Typedef Documentation

typedef std::string mlclient::Collection

Typedef for a Collection as a string.

Since
8.0.2
typedef std::vector<Collection>::const_iterator mlclient::CollectionIterator

Provides an Iterator over a set of Collection instances.

Since
8.0.2
typedef std::vector<Collection> mlclient::CollectionSet

Represents a set of Collection object instances.

Since
8.0.2
typedef std::vector<Document>::const_iterator mlclient::DocumentIterator

Provides an Iterator over a set of document instances.

Since
8.0.2
typedef std::vector<Document> mlclient::DocumentSet

Represents a set of Document object instances.

Since
8.0.2
typedef std::string mlclient::DocumentUri

Typedef for a Document URI as a string.

Since
8.0.2
typedef std::vector<DocumentUri>::const_iterator mlclient::DocumentUriIterator

Provides an Iterator over a set of DocumentUri instances.

Since
8.0.2
typedef std::vector<DocumentUri> mlclient::DocumentUriSet

Represents a set of DocumentUri object instances.

Since
8.0.2
typedef std::vector<Permission>::const_iterator mlclient::PermissionIterator

Provides an Iterator over a set of Permission instances.

Since
8.0.2
typedef std::vector<Permission> mlclient::PermissionSet

Represents a set of Permission object instances.

Since
8.0.2

Enumeration Type Documentation

enum mlclient::BinaryEncoding : int
strong

An enumeration for use with the BinaryDocumentContent class.

There are many ways to encode a Binary document as a string. This enum allows them to be described.

enum mlclient::Format
strong

Represents the format of the results

Represents the type of response received from the aggregate.

There are multiple formats returned from the MarkLogic REST API's aggregate calls. The OOTB aggregates return a simple vlaue element, which is a double encoded as a string. The REST API can also return full map:map() results from UDFs that use this capability. This is either a single map of string keys to typed values, or an array of maps.

Note
Currently there is a bug in the REST API that causes it only to return the first numeric value from the first element in the map array. This also has side effects for very large numbers. https://bugtrack.marklogic.com/41650

This implementation is therefore necessarily flexible at the cost of programmatic precision and ease.

The SIMPLE_DOUBLE response will be used for all OOTB aggregates from MarkLogic, and any UDF aggregate that returns a single double value. COMPLEX_MAP_ARRAY will be used where a single map instance is returned, or an array is returned. This is because this tier cannot detect from the response whether the UDF only returns one map by design, or just happened to return a single map instance on this one occasion.

Since
8.0.2

Function Documentation

MLCLIENT_API void mlclient::reconfigureLogging ( int  argc,
const char *  argv[] 
)

Reconfigure logging from command line args.

–log-folder "/some/folder/location" Specifies the folder within which logging is done (and enables file logging), disabled by default –log-level INFO|DEBUG Specify either INFO or DEBUG log level. Defaults to INFO in Release builds, or DEBUG in Debug builds. –log-stdout true Specify log messages should also be copied to stdout (the terminal, typically). Defaults to false

Since
8.0.2
MLCLIENT_API void mlclient::reconfigureLoggingSettings ( const LoggingConfiguration config)

Reconfigures logging from a LoggingConfiguration struct.

Parameters
[in]configThe LoggingConfiguration to use