libcamgm
|
#include <UrlBase.hpp>
Public Types | |
enum | EViewOption { WITH_SCHEME = 1L << 0, WITH_USERNAME = 1L << 1, WITH_PASSWORD = 1L << 2, WITH_HOST = 1L << 3, WITH_PORT = 1L << 4, WITH_PATH_NAME = 1L << 5, WITH_PATH_PARAMS = 1L << 6, WITH_QUERY_STR = 1L << 7, WITH_FRAGMENT = 1L << 8, EMPTY_AUTHORITY = 1L << 10, EMPTY_PATH_NAME = 1L << 11, EMPTY_PATH_PARAMS = 1L << 12, EMPTY_QUERY_STR = 1L << 13, EMPTY_FRAGMENT = 1L << 14 } |
Public Member Functions | |
ViewOptions () | |
ViewOptions & | operator= (const ViewOptions &v) |
ViewOptions & | operator+= (const ViewOptions &v) |
ViewOptions & | operator+= (EViewOption o) |
ViewOptions & | operator-= (const ViewOptions &v) |
ViewOptions & | operator-= (EViewOption o) |
bool | has (EViewOption o) const |
bool | has (const ViewOptions &v) const |
Private Member Functions | |
ViewOptions (int o) | |
Private Attributes | |
int | opt |
Friends | |
ViewOptions | operator+ (const ViewOptions &lv, const ViewOptions &rv) |
ViewOptions | operator+ (const ViewOptions &v, EViewOption o) |
ViewOptions | operator+ (const EViewOption lo, EViewOption ro) |
ViewOptions | operator- (const ViewOptions &vl, const ViewOptions &vr) |
ViewOptions | operator- (const ViewOptions &v, EViewOption o) |
Url::asString() view options.
A instance of this class represents a combination of view options.
It provides ViewOptions::operator+() and ViewOptions::operator-() to modify a view option combination and a ViewOptions::has() method, to check if a specified option is enabled or not.
Enumeration of view option constants.
Enumerator | |
---|---|
WITH_SCHEME |
Option to include scheme name in the URL string. Disabling this option causes, that the URL string contains the path, query and fragment components only, for example just "/foo/bar.txt". This option is enabled by default. |
WITH_USERNAME |
Option to include username in the URL string. This option depends on a enabled WITH_SCHEME and WITH_HOST options and is enabled by default. |
WITH_PASSWORD |
Option to include password in the URL string. This option depends on a enabled WITH_SCHEME, WITH_HOST and WITH_USERNAME options and is disabled by default, causing to hide the password in the URL authority. |
WITH_HOST |
Option to include hostname in the URL string. This option depends on a enabled WITH_SCHEME option and is enabled by default. |
WITH_PORT |
Option to include port number in the URL string. This option depends on a enabled WITH_SCHEME and WITH_HOST options and is enabled by default. |
WITH_PATH_NAME |
Option to include path name in the URL string. This option is enabled by default. |
WITH_PATH_PARAMS |
Option to include path parameters in the URL string. This option depends on a enabled WITH_PATH_NAME option and is disabled by default, causing to hide the path parameters. |
WITH_QUERY_STR |
Option to include query string in the URL string. This option is enabled by default. |
WITH_FRAGMENT |
Option to include fragment string in the URL string. This option is enabled by default. |
EMPTY_AUTHORITY |
Explicitely include the URL authority separator "//". It causes, that the URL string includes an empty URL authority, for example: "file:///foo.txt" instead of just "file:/foo.txt". This option depends on a enabled WITH_SCHEME view option and is enabled by default. |
EMPTY_PATH_NAME |
Explicitely include the "/" path character. It causes, that a "/" is added to the Url if the path name is empty, for example: "http://localhost/" instead of just "http://localhost". This option depends on a enabled WITH_PATH_NAME view option and is enabled by default. |
EMPTY_PATH_PARAMS |
Explicitely include the path parameters separator ";". It causes, that the URL allways contains the ";" path parameters separator. This option depends on a enabled EMPTY_PATH_NAME view option and is disabled by default. |
EMPTY_QUERY_STR |
Explicitely include the query string separator "?". It causes, that if the query string is requested using the WITH_QUERY_STR option, the URL allways contains the "?" query string separator, even if the query string is empty. This option depends on a enabled WITH_QUERY_STR view option and is disabled by default. |
EMPTY_FRAGMENT |
Explicitely include the fragment string separator "#". It causes, that if the fragment string is requested using the WITH_FRAGMENT option, the URL allways contains the "#" fragment string separator, even if the fragment string is empty. This option depends on a enabled WITH_FRAGMENT view option and is disabled by default. |
ca_mgm::url::ViewOptions::ViewOptions | ( | ) |
Create instance with default combination of view options.
By default, following view options are enabled: WITH_SCHEME, WITH_USERNAME, WITH_HOST, WITH_PORT, WITH_PATH_NAME, WITH_QUERY_STR, WITH_FRAGMENT, EMPTY_AUTHORITY, EMPTY_PATH_NAME.
|
private |
|
inline |
Check if specified option o
is set in the current object.
o | A view option constant. |
o
is set/enabled in the current object.
|
inline |
Check if specified options o
are set in the current object.
o | A view options set. |
o
are set/enabled in the current object. References opt.
|
inline |
References opt.
|
inline |
|
inline |
References opt.
|
inline |
|
inline |
Assign specified option combination o
to the current object.
o | The option or option combination to make a copy of. |
References opt.
|
friend |
Adds l
and r
to a new option combination.
|
friend |
|
friend |
|
friend |
Substract r
from l
to a new option combination.
|
friend |
|
private |
Referenced by has(), operator+=(), operator-=(), and operator=().