ARC SDK
|
Class to hold a resolved URL location. More...
#include <arc/URL.h>
Public Member Functions | |
URLLocation (const std::string &url="") | |
Creates a URLLocation from a string representation. | |
URLLocation (const std::string &url, const std::string &name) | |
Creates a URLLocation from a string representation and a name. | |
URLLocation (const URL &url) | |
Creates a URLLocation from a URL. | |
URLLocation (const URL &url, const std::string &name) | |
Creates a URLLocation from a URL and a name. | |
URLLocation (const std::map< std::string, std::string > &options, const std::string &name) | |
Creates a URLLocation from options and a name. | |
virtual | ~URLLocation () |
URLLocation destructor. | |
const std::string & | Name () const |
Returns the URLLocation name. | |
virtual std::string | str () const |
Returns a string representation of the URLLocation. | |
virtual std::string | fullstr () const |
Returns a string representation including options and locations. | |
![]() | |
URL () | |
Empty constructor. URL object is invalid. | |
URL (const std::string &url, bool encoded=false) | |
Constructs a new URL from a string representation. | |
virtual | ~URL () |
Empty destructor. | |
void | URIDecode (void) |
Perform decoding of stored URL parts according to RFC 3986. More... | |
const std::string & | Protocol () const |
Returns the protocol of the URL. | |
void | ChangeProtocol (const std::string &newprot) |
Changes the protocol of the URL. | |
const std::string & | Username () const |
Returns the username of the URL. | |
const std::string & | Passwd () const |
Returns the password of the URL. | |
const std::string & | Host () const |
Returns the hostname of the URL. | |
void | ChangeHost (const std::string &newhost) |
Changes the hostname of the URL. | |
int | Port () const |
Returns the port of the URL. | |
void | ChangePort (int newport) |
Changes the port of the URL. | |
const std::string & | Path () const |
Returns the path of the URL. | |
std::string | FullPath () const |
Returns the path of the URL with all options attached. | |
std::string | FullPathURIEncoded () const |
Returns the path and all options, URI-encoded according to RFC 3986. More... | |
void | ChangePath (const std::string &newpath) |
Changes the path of the URL. | |
void | ChangeFullPath (const std::string &newpath, bool encoded=false) |
Changes the path of the URL and all options attached. | |
const std::map< std::string, std::string > & | HTTPOptions () const |
Returns HTTP options if any. | |
const std::string & | HTTPOption (const std::string &option, const std::string &undefined="") const |
Returns the value of an HTTP option. More... | |
bool | AddHTTPOption (const std::string &option, const std::string &value, bool overwrite=true) |
Adds a HTP option with the given value. More... | |
void | RemoveHTTPOption (const std::string &option) |
Removes a HTTP option if exists. More... | |
const std::list< std::string > & | LDAPAttributes () const |
Returns the LDAP attributes if any. | |
void | AddLDAPAttribute (const std::string &attribute) |
Adds an LDAP attribute. | |
Scope | LDAPScope () const |
Returns the LDAP scope. | |
void | ChangeLDAPScope (const Scope newscope) |
Changes the LDAP scope. | |
const std::string & | LDAPFilter () const |
Returns the LDAP filter. | |
void | ChangeLDAPFilter (const std::string &newfilter) |
Changes the LDAP filter. | |
const std::map< std::string, std::string > & | Options () const |
Returns URL options if any. | |
const std::string & | Option (const std::string &option, const std::string &undefined="") const |
Returns the value of a URL option. More... | |
const std::map< std::string, std::string > & | MetaDataOptions () const |
Returns metadata options if any. | |
const std::string & | MetaDataOption (const std::string &option, const std::string &undefined="") const |
Returns the value of a metadata option. More... | |
bool | AddOption (const std::string &option, const std::string &value, bool overwrite=true) |
Adds a URL option with the given value. More... | |
bool | AddOption (const std::string &option, bool overwrite=true) |
Adds a URL option where option has the format "name=value". More... | |
void | AddMetaDataOption (const std::string &option, const std::string &value, bool overwrite=true) |
Adds a metadata option. | |
void | AddLocation (const URLLocation &location) |
Adds a Location. | |
const std::list< URLLocation > & | Locations () const |
Returns the locations if any. | |
const std::map< std::string, std::string > & | CommonLocOptions () const |
Returns the common location options if any. | |
const std::string & | CommonLocOption (const std::string &option, const std::string &undefined="") const |
Returns the value of a common location option. More... | |
void | RemoveOption (const std::string &option) |
Removes a URL option if exists. More... | |
void | RemoveMetaDataOption (const std::string &option) |
Remove a metadata option if exits. More... | |
virtual std::string | str (bool encode=false) const |
Returns a string representation of the URL including meta-options. | |
virtual std::string | plainstr (bool encode=false) const |
Returns a string representation of the URL without any options. | |
virtual std::string | fullstr (bool encode=false) const |
Returns a string representation including options and locations. | |
virtual std::string | ConnectionURL () const |
Returns a string representation with protocol, host and port only. | |
bool | operator< (const URL &url) const |
Compares one URL to another. | |
bool | operator== (const URL &url) const |
Is one URL equal to another? | |
operator bool () const | |
Check if instance holds valid URL. | |
bool | operator! () const |
Check if instance does not hold valid URL. | |
bool | StringMatches (const std::string &str) const |
Returns true if string matches url. | |
std::map< std::string, std::string > | ParseOptions (const std::string &optstring, char separator, bool encoded=false) |
Parse a string of options separated by separator into an attribute->value map. | |
Protected Attributes | |
std::string | name |
the URLLocation name as registered in the indexing service. | |
![]() | |
std::string | protocol |
the url protocol. | |
std::string | username |
username of the url. | |
std::string | passwd |
password of the url. | |
std::string | host |
hostname of the url. | |
bool | ip6addr |
if host is IPv6 numerical address notation. | |
int | port |
portnumber of the url. | |
std::string | path |
the url path. | |
std::map< std::string, std::string > | httpoptions |
HTTP options of the url. | |
std::map< std::string, std::string > | metadataoptions |
Meta data options. | |
std::list< std::string > | ldapattributes |
LDAP attributes of the url. | |
Scope | ldapscope |
LDAP scope of the url. | |
std::string | ldapfilter |
LDAP filter of the url. | |
std::map< std::string, std::string > | urloptions |
options of the url. | |
std::list< URLLocation > | locations |
locations for index server URLs. | |
std::map< std::string, std::string > | commonlocoptions |
common location options for index server URLs. | |
bool | valid |
flag to describe validity of URL | |
Additional Inherited Members | |
![]() | |
enum | Scope |
Scope for LDAP URLs. | |
![]() | |
static std::string | OptionString (const std::map< std::string, std::string > &options, char separator, bool encode=false) |
Returns a string representation of the options given in the options map. More... | |
static std::string | URIEncode (const std::string &str) |
Perform encoding according to RFC 3986. More... | |
static std::string | URIDecode (const std::string &str) |
Perform decoding according to RFC 3986. More... | |
![]() | |
void | ParsePath (bool encoded=false) |
Convenience method for splitting schema specific part into path and options. | |
![]() | |
static std::string | BaseDN2Path (const std::string &) |
a private method that converts an ldap basedn to a path. | |
static std::string | Path2BaseDN (const std::string &) |
a private method that converts an ldap path to a basedn. | |
Class to hold a resolved URL location.
It is specific to file indexing service registrations.