From 1020fe874728bc0dc2475ee4713b91777e0ca8a2 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 18 Sep 2023 22:58:52 +0000 Subject: [PATCH] Mark visible and add docs Signed-off-by: Michael Carroll --- include/gz/fuel_tools/Helpers.hh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/gz/fuel_tools/Helpers.hh b/include/gz/fuel_tools/Helpers.hh index 95f4fc05..1bcaf94c 100644 --- a/include/gz/fuel_tools/Helpers.hh +++ b/include/gz/fuel_tools/Helpers.hh @@ -37,7 +37,19 @@ namespace gz::fuel_tools { - +/// \brief Convert the authority portion of a URI to a string +/// suitable to be used as a path on disk for all platforms. +/// +/// It encodes illegal characters on Windows and Linux filesystems with +/// their corresponding URL-encoded values. +/// +/// This assumes an authority of the form: username@host:port +/// "@" is encoded as %40 +/// ":" is encoded as %3A +/// +/// \param[in] _uriAuthority the authority section of the URI to convert. +/// \return String suitable to use in file paths +GZ_FUEL_TOOLS_VISIBLE std::string sanitizeAuthority(const std::string &_uriAuthority); /// \brief Convert a URI to a string suitable to use as a path on disk.