UriUtil¶
-
class
kanzi::connect
::
UriUtil
¶ Contains uri parts splitted.
Public Functions
-
inline string
getWithoutPath
() const¶ Retrieve URI without path.
- Returns
uri without path
-
inline string
joinPathParts
(string separator = "/")¶ Returns path parts joined with the provided string.
- Parameters
separator – The separator string. Optional.
- Returns
Constructed string.
-
inline string
pathAt
(int position)¶ Retrieves a part of a path.
- Parameters
position – Position of the path.
- Returns
Part of path
-
inline void
reset
()¶ Clears the inners of the class.
-
bool
split
(const string &uri)¶ Splits a string format uri into its parts.
- Parameters
uri – the uri to be split E.g. service://cluster/path/to/data
- Returns
true if uri is overall valid.
-
inline bool
valid
() const¶ Is object valid.
- Returns
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”
- Parameters
source – the source to process
- Returns
the domain
-
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”
- Parameters
source – the source to process
- Returns
the path parts.
-
static string
removeProtocol
(const string &uri)¶ Removes the protocol portion, e.g.
service:// from the uri
- Parameters
uri – where to remove the procotocl from
- Returns
the path without the protocol.
-
inline string