A class that allows to translate pre-formatted URIs that follow special syntax to local and file server URIs that can be used to retrieve data.
More...
#include <uri_translator.hpp>
|
static bool | needsTranslation (const string &uri, bool &needsEncoding) |
| Check if given string is URI that needs an address translation to be usable.
|
|
static void | upcaseHostName (string &uri) |
| Ensures the symbolic hostname, for example <server>, is uppercase in the URI.
|
|
A class that allows to translate pre-formatted URIs that follow special syntax to local and file server URIs that can be used to retrieve data.
◆ UriTranslator()
kanzi::connect::UriTranslator::UriTranslator |
( |
| ) |
|
◆ ~UriTranslator()
virtual kanzi::connect::UriTranslator::~UriTranslator |
( |
| ) |
|
|
virtual |
◆ clearHostAddress()
void kanzi::connect::UriTranslator::clearHostAddress |
( |
const string & | name | ) |
|
Remove host.
Host is no longer used when translating URIs.
- Parameters
-
name | Name of the host to remove. |
◆ needsTranslation()
static bool kanzi::connect::UriTranslator::needsTranslation |
( |
const string & | uri, |
|
|
bool & | needsEncoding ) |
|
static |
Check if given string is URI that needs an address translation to be usable.
- Parameters
-
- Returns
- True if UriTranslator::translate should be called on the given string to turn it into usable URI
◆ setHostAddress()
void kanzi::connect::UriTranslator::setHostAddress |
( |
const string & | name, |
|
|
const string & | ip ) |
Set host address that can be used when uris are translated.
- Parameters
-
name | Name of the host. |
ip | IP address of the host. |
◆ translate()
string kanzi::connect::UriTranslator::translate |
( |
const string & | uri, |
|
|
bool | encode ) |
Translates uri to local or file server uri.
- Parameters
-
uri | URI to translate. |
encode | To encode URI (remove spaces, and so on) set to True. To keep intact, set to False. |
- Returns
- Translated URI, or original if there is no need to translate.
◆ upcaseHostName()
static void kanzi::connect::UriTranslator::upcaseHostName |
( |
string & | uri | ) |
|
|
static |
Ensures the symbolic hostname, for example <server>, is uppercase in the URI.
- Parameters
-
uri | the uri to be processed. |
The documentation for this class was generated from the following file:
- connect/uri_translator.hpp