80 #include <unordered_map>
83 #include "../base/macros.h"
114 bool load(const std::
string& file_path) noexcept;
121 bool unload() noexcept;
129 bool reload(const std::
string& file_path) noexcept;
140 const std::
string&
convert(const std::
string& url) noexcept;
147 void set_enable_log(
bool enable_log) noexcept;
154 [[nodiscard]]
bool is_enable_log() const noexcept;
161 [[nodiscard]]
bool is_valid() const noexcept;
168 [[nodiscard]] const std::
string& get_error_string() const noexcept;
171 bool is_enable_log_{
false};
172 bool is_valid_{
false};
174 std::string error_string_;
176 std::vector<std::pair<std::string, std::string>> remap_list_;
177 std::unordered_map<std::string, std::string> cache_map_;
Loads a JSON rewrite table and substitutes VLink URLs at runtime.
Definition: url_remap.h:95
UrlRemap() noexcept
Constructs an empty, unloaded instance.
bool is_valid() const noexcept
Reports whether a rewrite table has been successfully loaded.
Definition: url_remap.h:190
const std::string & get_error_string() const noexcept
Returns the diagnostic message produced by the last failure.
Definition: url_remap.h:192
void set_enable_log(bool enable_log) noexcept
Toggles per-conversion INFO logging.
Definition: url_remap.h:186
bool is_enable_log() const noexcept
Reports whether per-conversion logging is enabled.
Definition: url_remap.h:188
#define VLINK_EXPORT
Definition: macros.h:81
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition: macros.h:174
constexpr bool is_valid() noexcept
Definition: name_detector.h:382
bool convert(const SrcT &src, DesT &des)
Converts between two types where at least one side is Bytes.
Definition: serializer-inl.h:681