Poco::RemotingNG

class URIUtility

Library: RemotingNG
Package: RemotingNG
Header: Poco/RemotingNG/URIUtility.h

Description

This class provides utility methods for parsing and creating RemotingNG URIs.

Member Summary

Member Functions: createURIAuthority, createURIPath, matchPath, parseURIPath

Member Functions

createURIAuthority static

static std::string createURIAuthority(
    const std::string & host,
    Poco::UInt16 port
);

Creates an URI authority (e.g. host:port) from the given parameters.

createURIPath static

static std::string createURIPath(
    const Identifiable::ObjectId & oid,
    const Identifiable::TypeId & tid,
    const std::string & protocol
);

Creates an URI path from the given input parameters.

matchPath static

static bool matchPath(
    const std::string & path,
    const std::string & pathTemplate
);

Matches the given path against the path template. A path template can contain placeholders for certain path segments. The format of a place holder is {<identifier>}, an identifier enclosed in curly brackets. For example, the path "/object/12345" will match the path template "/object/{id}".

Returns true if the path matches the pathTemplate, otherwise false.

parseURIPath static

static void parseURIPath(
    const std::string & uri,
    Identifiable::ObjectId & oid,
    Identifiable::TypeId & tid,
    std::string & protocol
);

Parses an URI containing a path created by createURIPath().

Throws an exception if the URI format is not recognized.