ARC SDK
Public Member Functions | Protected Attributes
Arc::URLLocation Class Reference

Class to hold a resolved URL location. More...

#include <arc/URL.h>

Inheritance diagram for Arc::URLLocation:
Arc::URL

Public Member Functions

 URLLocation (const std::string &url="")
 Creates a URLLocation from a string representation. More...
 
 URLLocation (const std::string &url, const std::string &name)
 Creates a URLLocation from a string representation and a name. More...
 
 URLLocation (const URL &url)
 Creates a URLLocation from a URL. More...
 
 URLLocation (const URL &url, const std::string &name)
 Creates a URLLocation from a URL and a name. More...
 
 URLLocation (const std::map< std::string, std::string > &options, const std::string &name)
 Creates a URLLocation from options and a name. More...
 
virtual ~URLLocation ()
 URLLocation destructor. More...
 
const std::string & Name () const
 Returns the URLLocation name. More...
 
virtual std::string str (bool encode=false) const
 Returns a string representation of the URLLocation. More...
 
virtual std::string fullstr (bool encode=false) const
 Returns a string representation including options and locations. More...
 
- Public Member Functions inherited from Arc::URL
 URL ()
 Empty constructor. URL object is invalid. More...
 
 URL (const std::string &url, bool encoded=false, int defaultPort=-1, const std::string &defaultPath="")
 Constructs a new URL from a string representation. More...
 
virtual ~URL ()
 Empty destructor. More...
 
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. More...
 
void ChangeProtocol (const std::string &newprot)
 Changes the protocol of the URL. More...
 
const std::string & Username () const
 Returns the username of the URL. More...
 
const std::string & Passwd () const
 Returns the password of the URL. More...
 
const std::string & Host () const
 Returns the hostname of the URL. More...
 
void ChangeHost (const std::string &newhost)
 Changes the hostname of the URL. More...
 
int Port () const
 Returns the port of the URL. More...
 
void ChangePort (int newport)
 Changes the port of the URL. More...
 
const std::string & Path () const
 Returns the path of the URL. More...
 
std::string FullPath () const
 Returns the path of the URL with all options attached. More...
 
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. More...
 
void ChangeFullPath (const std::string &newpath, bool encoded=false)
 Changes the path of the URL and all options attached. More...
 
void ChangeURL (const std::string &newurl, bool encoded=false)
 Changes whole URL possibly taking into account current one if new URL is relative. More...
 
const std::map< std::string, std::string > & HTTPOptions () const
 Returns HTTP options if any. More...
 
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. More...
 
void AddLDAPAttribute (const std::string &attribute)
 Adds an LDAP attribute. More...
 
Scope LDAPScope () const
 Returns the LDAP scope. More...
 
void ChangeLDAPScope (const Scope newscope)
 Changes the LDAP scope. More...
 
const std::string & LDAPFilter () const
 Returns the LDAP filter. More...
 
void ChangeLDAPFilter (const std::string &newfilter)
 Changes the LDAP filter. More...
 
const std::map< std::string, std::string > & Options () const
 Returns URL options if any. More...
 
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. More...
 
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. More...
 
void AddLocation (const URLLocation &location)
 Adds a Location. More...
 
const std::list< URLLocation > & Locations () const
 Returns the locations if any. More...
 
const std::map< std::string, std::string > & CommonLocOptions () const
 Returns the common location options if any. More...
 
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 plainstr (bool encode=false) const
 Returns a string representation of the URL without any options. More...
 
virtual std::string ConnectionURL () const
 Returns a string representation with protocol, host and port only. More...
 
bool operator< (const URL &url) const
 Compares one URL to another. More...
 
bool operator== (const URL &url) const
 Is one URL equal to another? More...
 
 operator bool () const
 Check if instance holds valid URL. More...
 
bool operator! () const
 Check if instance does not hold valid URL. More...
 
bool StringMatches (const std::string &str) const
 Returns true if string matches url. More...
 
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. More...
 

Protected Attributes

std::string name
 the URLLocation name as registered in the indexing service. More...
 
- Protected Attributes inherited from Arc::URL
std::string protocol
 the url protocol. More...
 
std::string username
 username of the url. More...
 
std::string passwd
 password of the url. More...
 
std::string host
 hostname of the url. More...
 
bool ip6addr
 if host is IPv6 numerical address notation. More...
 
int port
 portnumber of the url. More...
 
std::string path
 the url path. More...
 
std::map< std::string, std::string > httpoptions
 HTTP options of the url. More...
 
std::map< std::string, std::string > metadataoptions
 Meta data options. More...
 
std::list< std::string > ldapattributes
 LDAP attributes of the url. More...
 
Scope ldapscope
 LDAP scope of the url. More...
 
std::string ldapfilter
 LDAP filter of the url. More...
 
std::map< std::string, std::string > urloptions
 options of the url. More...
 
std::list< URLLocationlocations
 locations for index server URLs. More...
 
std::map< std::string, std::string > commonlocoptions
 common location options for index server URLs. More...
 
bool valid
 flag to describe validity of URL More...
 

Additional Inherited Members

- Public Types inherited from Arc::URL
enum  Scope { base, onelevel, subtree }
 Scope for LDAP URLs. More...
 
- Static Public Member Functions inherited from Arc::URL
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...
 
- Protected Member Functions inherited from Arc::URL
void ParsePath (bool encoded=false)
 Convenience method for splitting schema specific part into path and options. More...
 
- Static Protected Member Functions inherited from Arc::URL
static std::string BaseDN2Path (const std::string &)
 a private method that converts an ldap basedn to a path. More...
 
static std::string Path2BaseDN (const std::string &)
 a private method that converts an ldap path to a basedn. More...
 

Detailed Description

Class to hold a resolved URL location.

It is specific to file indexing service registrations.

Constructor & Destructor Documentation

◆ URLLocation() [1/5]

Arc::URLLocation::URLLocation ( const std::string &  url = "")

Creates a URLLocation from a string representation.

◆ URLLocation() [2/5]

Arc::URLLocation::URLLocation ( const std::string &  url,
const std::string &  name 
)

Creates a URLLocation from a string representation and a name.

◆ URLLocation() [3/5]

Arc::URLLocation::URLLocation ( const URL url)

Creates a URLLocation from a URL.

◆ URLLocation() [4/5]

Arc::URLLocation::URLLocation ( const URL url,
const std::string &  name 
)

Creates a URLLocation from a URL and a name.

◆ URLLocation() [5/5]

Arc::URLLocation::URLLocation ( const std::map< std::string, std::string > &  options,
const std::string &  name 
)

Creates a URLLocation from options and a name.

◆ ~URLLocation()

virtual Arc::URLLocation::~URLLocation ( )
virtual

URLLocation destructor.

Member Function Documentation

◆ fullstr()

virtual std::string Arc::URLLocation::fullstr ( bool  encode = false) const
virtual

Returns a string representation including options and locations.

Reimplemented from Arc::URL.

◆ Name()

const std::string& Arc::URLLocation::Name ( ) const

Returns the URLLocation name.

◆ str()

virtual std::string Arc::URLLocation::str ( bool  encode = false) const
virtual

Returns a string representation of the URLLocation.

Reimplemented from Arc::URL.

Field Documentation

◆ name

std::string Arc::URLLocation::name
protected

the URLLocation name as registered in the indexing service.


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