#include <Url.hpp>
Public Types | |
| typedef limal::url::EEncoding | EEncoding |
| typedef limal::url::ViewOptions | ViewOptions |
Public Member Functions | |
| ~Url () | |
| Url () | |
| Url (const Url &url) | |
| Url (const limal::url::UrlRef &url) | |
| Url (const BLOCXX_NAMESPACE::String &urlString) | |
| Construct a Url object from percent-encoded URL string. | |
| Url & | operator= (const BLOCXX_NAMESPACE::String &urlString) |
| Assigns parsed percent-encoded URL string to the object. | |
| Url & | operator= (const Url &url) |
Assign shared copy of url to the current object. | |
| BLOCXX_NAMESPACE::StringArray | getKnownSchemes () const |
| Returns scheme names known to this object. | |
| bool | isValidScheme (const BLOCXX_NAMESPACE::String &scheme) const |
| Verifies specified scheme name. | |
| bool | isValid () const |
| Verifies the Url. | |
| BLOCXX_NAMESPACE::String | toString () const |
| BLOCXX_NAMESPACE::String | toString (const ViewOptions &opts) const |
| BLOCXX_NAMESPACE::String | toCompleteString () const |
| BLOCXX_NAMESPACE::String | getScheme () const |
| BLOCXX_NAMESPACE::String | getAuthority () const |
| BLOCXX_NAMESPACE::String | getUsername (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getPassword (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getHost (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getPort () const |
| BLOCXX_NAMESPACE::String | getPathData () const |
| BLOCXX_NAMESPACE::String | getPathName (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getPathParams () const |
| BLOCXX_NAMESPACE::StringArray | getPathParamsArray () const |
| limal::url::ParamMap | getPathParamsMap (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getPathParam (const BLOCXX_NAMESPACE::String ¶m, EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getQueryString () const |
| BLOCXX_NAMESPACE::StringArray | getQueryStringArray () const |
| limal::url::ParamMap | getQueryStringMap (EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getQueryParam (const BLOCXX_NAMESPACE::String ¶m, EEncoding eflag=limal::url::E_DECODED) const |
| BLOCXX_NAMESPACE::String | getFragment (EEncoding eflag=limal::url::E_DECODED) const |
| void | setScheme (const BLOCXX_NAMESPACE::String &scheme) |
| Set the scheme name in the URL. | |
| void | setAuthority (const BLOCXX_NAMESPACE::String &authority) |
| Set the authority component in the URL. | |
| void | setUsername (const BLOCXX_NAMESPACE::String &user, EEncoding eflag=limal::url::E_DECODED) |
| Set the username in the URL authority. | |
| void | setPassword (const BLOCXX_NAMESPACE::String &pass, EEncoding eflag=limal::url::E_DECODED) |
| Set the password in the URL authority. | |
| void | setHost (const BLOCXX_NAMESPACE::String &host, EEncoding eflag=limal::url::E_DECODED) |
| Set the hostname or IP in the URL authority. | |
| void | setPort (const BLOCXX_NAMESPACE::String &port) |
| Set the port number in the URL authority. | |
| void | setPathData (const BLOCXX_NAMESPACE::String &pathdata) |
| Set the path data component in the URL. | |
| void | setPathName (const BLOCXX_NAMESPACE::String &path, EEncoding eflag=limal::url::E_DECODED) |
| Set the path name. | |
| void | setPathParams (const BLOCXX_NAMESPACE::String ¶ms) |
| Set the path parameters. | |
| void | setPathParamsArray (const BLOCXX_NAMESPACE::StringArray &parray) |
| Set the path parameters. | |
| void | setPathParamsMap (const limal::url::ParamMap &pmap) |
| Set the path parameters. | |
| void | setPathParam (const BLOCXX_NAMESPACE::String ¶m, const BLOCXX_NAMESPACE::String &value) |
| Set or add value for the specified path parameter. | |
| void | setQueryString (const BLOCXX_NAMESPACE::String &querystr) |
| Set the query string in the URL. | |
| void | setQueryStringArray (const BLOCXX_NAMESPACE::StringArray &qarray) |
| Set the query parameters. | |
| void | setQueryStringMap (const limal::url::ParamMap &qmap) |
| Set the query parameters. | |
| void | setQueryParam (const BLOCXX_NAMESPACE::String ¶m, const BLOCXX_NAMESPACE::String &value) |
| Set or add value for the specified query parameter. | |
| void | setFragment (const BLOCXX_NAMESPACE::String &fragment, EEncoding eflag=limal::url::E_DECODED) |
| Set the fragment string in the URL. | |
| ViewOptions | getViewOptions () const |
| void | setViewOptions (const ViewOptions &vopts) |
Static Public Member Functions | |
| static url::UrlRef | parseUrl (const BLOCXX_NAMESPACE::String &urlString) |
| Parse a percent-encoded URL string. | |
Private Attributes | |
| url::UrlRef | m_impl |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Url &url) |
The generic URL (URI) syntax and its main components are defined in RFC3986 (http://rfc.net/rfc3986.html) Section 3, "Syntax Components". The scheme specific URL syntax and semantics is defined in the specification of the particular scheme. See also RFC1738 (http://rfc.net/rfc1738.html), that defines specific syntax for several URL schemes.
This class provides methods to access and manipulate generic and common scheme-specific URL components (or using the more general term, URI components). To consider the scheme-specifics of a URL, the Url class contains a reference object pointing to a UrlBase or derived object, that implements the scheme specifics.
Using the Url::registerScheme() method, it is possible to register a preconfigured or derived UrlBase object for a specific scheme name. The registered object will be cloned to handle all URL's containing the specified scheme name.
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty
The scheme and path components are required, though the path may be empty (no characters). When authority is present, the path must either be empty or begin with a slash ("/") character. When authority is not present, the path cannot begin with two slash characters ("//"). These restrictions result in five different ABNF rules for a path (Section 3.3), only one of which will match any given URI reference.
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose
|
|
Encoding flags. |
|
|
View options. |
|
|
|
|
|
|
|
|
Create a new Url object as shared copy of the given one. Upon return, both objects will point to the same underlying object. This state will remain until one of the object is modified.
|
|
|
Create a new Url object as shared copy of the given reference. Upon return, both objects will point to the same underlying object. This state will remain until one of the object is modified.
|
|
|
Construct a Url object from percent-encoded URL string.
Parses the
|
|
|
Returns the encoded authority component of the URL. The returned authority string does not contain the leading "//" separator characters, but just its "user:pass@host:port" content only.
|
|
|
Returns the encoded fragment component of the URL.
|
|
|
Returns the hostname or IP from the URL authority. In case the Url contains an IP number, it may be surrounded by "[" and "]" characters, for example "[::1]" for an IPv6 localhost address.
|
|
|
Returns scheme names known to this object.
|
|
|
Returns the password from the URL authority.
|
|
|
Returns the encoded path component of the URL. The path data contains the path name, optionally followed by path parameters separated with a ";" character, for example "/foo/bar;version=1.1".
|
|
|
Returns the path name from the URL.
|
|
||||||||||||
|
Return the value for the specified path parameter. For example, if the path parameters string is "foo=1,bar=2" the method will return the substring "1" for the param key "foo" and "2" for the param key "bar".
|
|
|
Returns the path parameters from the URL.
|
|
|
Returns an array with path parameter substrings.
The default path parameter separator is the For example, the path parameters string "foo=1,bar=2" is splited by default into an array containing the substrings "foo=1" and "bar=2".
|
|
|
Returns a string map with path parameter keys and values.
The default path parameter separator is the For example, the path parameters string "foo=1,bar=2" is splited into a map containing "foo" = "1" and "bar" = "2" by default.
|
|
|
Returns the port from the URL authority.
|
|
||||||||||||
|
Return the value for the specified query parameter. For example, if the query string is "foo=1,bar=2" the method will return the substring "1" for the param key "foo" and "2" for the param key "bar".
|
|
|
Returns the encoded query string component of the URL. The query string is returned without first "?" (separator) character. Further "?" characters as in e.g. LDAP URL's remains in the returned string.
|
|
|
Returns an array with query string parameter substrings.
The default query string parameter separator is the For example, the query string "foo=1&bar=2" is splited by default into an array containing the substrings "foo=1" and "bar=2".
|
|
|
Returns a string map with query parameter and their values.
The default query string parameter separator is the For example, the query string "foo=1&bar=2" is splited by default into a map containing "foo" = "1" and "bar" = "2".
|
|
|
Returns the scheme name of the URL.
|
|
|
Returns the username from the URL authority.
|
|
|
Return the view options of the current object. This method is used to query the view options used by the asString() method.
|
|
|
Verifies the Url. Verifies if the current object contains a non-empty scheme name. Additional semantical URL checks may be performed by derived UrlBase objects.
|
|
|
Verifies specified scheme name.
Verifies the generic syntax of the specified The default implementation in the UrlBase class returns an emtpy list of known schemes, causing a check of the generic syntax only.
|
|
|
Assign shared copy of Upon return, both objects will point to the same underlying object. This state will remain until one of the object is modified.
|
|
|
Assigns parsed percent-encoded URL string to the object.
Parses
|
|
|
Parse a percent-encoded URL string. Trys to parses the given string into generic URL components and created a clone of a scheme-specialized object or a new UrlBase object.
|
|
|
Set the authority component in the URL.
The
|
|
||||||||||||
|
Set the fragment string in the URL.
|
|
||||||||||||
|
Set the hostname or IP in the URL authority.
The A hostname may contain national alphanumeric UTF8 characters (letters other than ASCII a-z0-9), that will be encoded. This function allows to specify both, a encoded or decoded hostname. Other IP literals in "[v ... ]" square bracket format are not supported by the implementation in UrlBase class.
|
|
||||||||||||
|
Set the password in the URL authority.
|
|
|
Set the path data component in the URL.
By default, the
|
|
||||||||||||
|
Set the path name.
|
|
||||||||||||
|
Set or add value for the specified path parameter.
|
|
|
Set the path parameters.
|
|
|
Set the path parameters.
|
|
|
Set the path parameters.
|
|
|
Set the port number in the URL authority.
|
|
||||||||||||
|
Set or add value for the specified query parameter.
|
|
|
Set the query string in the URL.
|
|
|
Set the query parameters.
|
|
|
Set the query parameters.
|
|
|
Set the scheme name in the URL.
|
|
||||||||||||
|
Set the username in the URL authority.
|
|
|
Change the view options of the current object. This method is used to change the view options used by the asString() method.
|
|
|
Returns a complete string representation of the Url object. This function ignores the configuration of the view options in the current object (see setViewOption()) and forces to return an string with all URL components included.
|
|
|
Returns a string representation of the Url object. To include a password in the resulting Url string, use: url.toString(url.getViewOptions() +
url::ViewOptions::WITH_PASSWORD);
|
|
|
Returns a default string representation of the Url object. By default, a password in the URL will be hidden.
|
|
||||||||||||
|
Stream output operator.
|
|
|
|
1.4.6