|
VLink
2.0.0
A high-performance communication middleware
|
Strict subset of an RFC 3986 URL parser used by the VLink transport layer. 更多...
类 | |
| class | vlink::UrlParser |
| Immutable URL decomposition used by the VLink transport router. 更多... | |
命名空间 | |
| vlink | |
Strict subset of an RFC 3986 URL parser used by the VLink transport layer.
This is an internal implementation header used by Protocol and the URL-driven transport routing path; application code does not interact with it directly. UrlParser decomposes a VLink topic URL into the parts that Url needs to select a transport Conf and to configure the resulting NodeImpl. Typical inputs look like:
| Component | Example | Description |
|---|---|---|
| transport | dds | URI scheme / VLink transport prefix before :// |
| content | //host/path | Full content portion after the scheme separator |
| username | user | Optional credential before host |
| password | pass | Optional credential after : |
| host | 127.0.0.1 | Hostname or IP address |
| port | 30490 | TCP / UDP port number |
| path | vehicle/speed | Topic path; leading slash stored separately |
| query | domain=1&qos=... | Raw query string after ? |
| fragment | section1 | Fragment identifier after # |
| Accessor | Resulting type |
|---|---|
get_transport() const | const std::string& |
get_category() const | Category |
get_content() const | const std::string& (non-hierarchical) |
get_username() const | const std::string& (hierarchical) |
get_password() const | const std::string& (hierarchical) |
get_host() const | const std::string& (hierarchical) |
get_port() const | int64_t (hierarchical) |
get_path() const | const std::string& (hierarchical) |
get_query() const | const std::string& |
get_query_dictionary() const | const std::map<std::string,std::string>& |
get_fragment() const | const std::string& |
to_string() const | std::string (reconstructed URL) |
std::map<std::string,std::string> using either & (default) or ; as the key/value pair separator. Each token is split on the first = character; keys without a value become empty strings.kHierarchical: standard scheme://authority/path?query::fragment URL.kNonHierarchical: opaque scheme:content form (e.g. mailto:user(at)host).UrlParser is a value type; parsing happens once during construction and accessors return references valid for the lifetime of the object.