UriUtil

class kanzi::connect::UriUtil

Contains uri parts splitted.

Public Functions

inline string getWithoutPath() const

Retrieve URI without path.

Return

uri without path

inline string joinPathParts(string separator = "/")

Returns path parts joined with the provided string.

Return

Constructed string.

Parameters
  • separator: The separator string. Optional.

inline string pathAt(int position)

Retrieves a part of a path.

Return

Part of path

Parameters
  • position: Position of the path.

inline void reset()

Clears the inners of the class.

bool split(const string &uri)

Splits a string format uri into its parts.

Return

true if uri is overall valid.

Parameters
  • uri: the uri to be split E.g. service://cluster/path/to/data

inline bool valid() const

Is object valid.

Return

true if valid.

Public Members

string domain

service://something/else => something

list<string> pathparts

path parts service://something/first/second => [0]=first,[1]=second

string protocol

service://something => service

Public Static Functions

static inline string getDomain(const string &source)

static function to return the domain part.

from servicedata://media/kissa/kala would return “media”

Return

the domain

Parameters
  • source: the source to process

static inline string joinedPathParts(const string &source)

static function to return joined path parts.

E.g. from servicedata://media/kissa/kala would return “kissa/kala”

Return

the path parts.

Parameters
  • source: the source to process

static string removeProtocol(const string &uri)

Removes the protocol portion, e.g.

service:// from the uri

Return

the path without the protocol.

Parameters
  • uri: where to remove the procotocl from