|
VLink 2.0.0
A high-performance communication middleware
|
JSON-driven URL remapping for VLink topic address translation. 更多...
类 | |
| class | vlink::UrlRemap |
| Loads a JSON remap file and translates VLink URL strings at runtime. 更多... | |
命名空间 | |
| namespace | vlink |
JSON-driven URL remapping for VLink topic address translation.
UrlRemap loads a JSON configuration file that maps source URL patterns to target URL strings, enabling topic renaming at runtime without recompiling.
The JSON format is a flat object of key/value pairs:
convert(), the remap list is searched in order. The first entry whose key is found as a substring of the input URL is selected, and its value is returned as the remapped URL. Results are cached in an internal unordered_map to avoid repeated linear scans.load() returns false (and sets the error string) if the file does not exist, cannot be parsed, or is already loaded.unload() clears the remap table and the result cache.convert() returns the original URL unchanged if is_valid() is false or no matching rule is found.