libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
BloombergLP::bmqt::UriParser Struct Reference

Utility namespace of methods for parsing URI strings into Uri objects.

#include <bmqt_uri.h>

Static Public Member Functions

static void initialize (bslma::Allocator *allocator=0)
 
static void shutdown ()
 
static int parse (Uri *result, bsl::string *errorDescription, const bslstl::StringRef &uriString)
 

Member Function Documentation

◆ initialize()

static void BloombergLP::bmqt::UriParser::initialize ( bslma::Allocator *  allocator = 0)
static

Initialize the UriParser. Note that this will compile the regular expression used by parseUri. This method only needs to be called once before any other method, but can be called multiple times provided that for each call to initialize there is a corresponding call to shutdown. Use the optionally specified allocator for any memory allocation, or the global allocator if none is provided. Note that specifying the allocator is provided for test drivers only, and therefore users should let it default to the global allocator.

◆ shutdown()

static void BloombergLP::bmqt::UriParser::shutdown ( )
static

Pendant operation of the initialize one. Note that behaviour after calling the .parse() method of the UriParser after shutdown has been called is undefined. The number of calls to shutdown must equal the number of calls to initialize, without corresponding shutdown calls, to fully destroy the parser. It is safe to call initialize after calling shutdown. Behaviour is undefined if shutdown is called without initialize first being called.

◆ parse()

static int BloombergLP::bmqt::UriParser::parse ( Uri result,
bsl::string *  errorDescription,
const bslstl::StringRef &  uriString 
)
static

Parse the specified uriString into the specified result object if uriString is a valid URI, otherwise load the specified errorDescription with a description of the syntax error present in uriString. Return 0 on success and non-zero if uriString does not have a valid syntax. Note that errorDescription may be null if the caller does not care about getting error messages. The behavior is undefined unless initialize has been called previously.


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