#include <UrlBase.hpp>
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.
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. |
limal::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.
limal::url::ViewOptions::ViewOptions | ( | int | o | ) | [private] |
bool limal::url::ViewOptions::has | ( | const ViewOptions & | v | ) | const [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.
bool limal::url::ViewOptions::has | ( | EViewOption | o | ) | const [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. ViewOptions& limal::url::ViewOptions::operator+= | ( | EViewOption | o | ) | [inline] |
ViewOptions& limal::url::ViewOptions::operator+= | ( | const ViewOptions & | v | ) | [inline] |
References opt.
ViewOptions& limal::url::ViewOptions::operator-= | ( | EViewOption | o | ) | [inline] |
ViewOptions& limal::url::ViewOptions::operator-= | ( | const ViewOptions & | v | ) | [inline] |
ViewOptions& limal::url::ViewOptions::operator= | ( | const ViewOptions & | v | ) | [inline] |
Assign specified option combination o
to the current object.
o | The option or option combination to make a copy of. |
References opt.
ViewOptions operator+ | ( | const EViewOption | lo, | |
EViewOption | ro | |||
) | [friend] |
ViewOptions operator+ | ( | const ViewOptions & | v, | |
EViewOption | o | |||
) | [friend] |
ViewOptions operator+ | ( | const ViewOptions & | lv, | |
const ViewOptions & | rv | |||
) | [friend] |
Adds l
and r
to a new option combination.
ViewOptions operator- | ( | const ViewOptions & | v, | |
EViewOption | o | |||
) | [friend] |
ViewOptions operator- | ( | const ViewOptions & | vl, | |
const ViewOptions & | vr | |||
) | [friend] |
Substract r
from l
to a new option combination.
int limal::url::ViewOptions::opt [private] |
Referenced by has(), operator+=(), and operator=().