VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
url_parser.h File Reference

RFC-compliant URL/URI parser used internally by the VLink transport layer. More...

#include <cstdint>
#include <map>
#include <string>
#include "../base/macros.h"
Include dependency graph for url_parser.h:

Go to the source code of this file.

Classes

 Immutable RFC-3986 URL parser. More...

Namespaces

Detailed Description

RFC-compliant URL/URI parser used internally by the VLink transport layer.

UrlParser decomposes a URL string into its constituent components following a strict subset of RFC 3986. It is used by Url to extract the URI scheme (which VLink treats as the transport prefix), host, path, and query parameters from VLink topic addresses such as:

dds://my_domain/vehicle/speed?domain_id=1&qos=best_effort
intra://my_topic
someip://127.0.0.1:30490/my_service?instance_id=1
Supported URL Components
Component Example Description
transport dds URI scheme / VLink transport prefix before ://
content //host/path Full content portion after the scheme
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
query domain_id=1&qos=... Raw query string after ?
fragment section1 Fragment identifier after #
Query Dictionary
The query string is automatically split into a std::map<string,string> using either & (default) or ; as the key-value pair separator. Values are split on the first = character.
Category
  • kHierarchical – standard scheme://authority/path?query#fragment syntax.
  • kNonHierarchical – opaque scheme:content syntax (e.g. mailto:user(at)host).
Note
UrlParser is a value type; it parses the URL at construction time and provides read-only accessors for each extracted component.