From 118ae4d0757d31398fff3be306af2fd980d5a74b Mon Sep 17 00:00:00 2001 From: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> Date: Wed, 26 Jun 2024 23:59:19 -0400 Subject: [PATCH] Update components/core/src/clp/ffi/utils.hpp Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> --- components/core/src/clp/ffi/utils.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/core/src/clp/ffi/utils.hpp b/components/core/src/clp/ffi/utils.hpp index 8a90169a1..26823da9c 100644 --- a/components/core/src/clp/ffi/utils.hpp +++ b/components/core/src/clp/ffi/utils.hpp @@ -17,11 +17,12 @@ namespace clp::ffi { ) -> std::optional; /** - * Validates whether the given string is UTF-8 encoded, and append the src to the dst by escaping - * any characters to make the string compatible with the JSON specification. - * @param src The source string to validate and escape. - * @param dst Outputs the destination string with escaped src appended. - * @return Whether the src is a valid UTF-8 encoded string. + * Validates whether `src` is UTF-8 encoded, and appends `src` to `dst` while escaping any + * characters to make the appended string compatible with the JSON specification. + * @param src The string to validate and escape. + * @param dst Returns `dst` with an escaped version of `src` appended. + * @return Whether `src` is a valid UTF-8-encoded string. NOTE: Even if `src` is not UTF-8 encoded, + * `dst` may be modified. */ [[nodiscard]] auto validate_and_append_escaped_utf8_string(std::string_view src, std::string& dst) -> bool;