Kanzi Connect 3.9.10
kanzi::connect::UriTranslator Class Reference

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>

Public Member Functions

void clearHostAddress (const string &name)
 Remove host.
 
void setHostAddress (const string &name, const string &ip)
 Set host address that can be used when uris are translated.
 
string translate (const string &uri, bool encode)
 Translates uri to local or file server uri.
 
 UriTranslator ()
 
virtual ~UriTranslator ()
 Destructor.
 

Static Public Member Functions

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ UriTranslator()

kanzi::connect::UriTranslator::UriTranslator ( )

◆ ~UriTranslator()

virtual kanzi::connect::UriTranslator::~UriTranslator ( )
virtual

Destructor.

Member Function Documentation

◆ clearHostAddress()

void kanzi::connect::UriTranslator::clearHostAddress ( const string & name)

Remove host.

Host is no longer used when translating URIs.

Parameters
nameName 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
uristring to check
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
nameName of the host.
ipIP address of the host.

◆ translate()

string kanzi::connect::UriTranslator::translate ( const string & uri,
bool encode )

Translates uri to local or file server uri.

Parameters
uriURI to translate.
encodeTo 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
urithe uri to be processed.

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