From aa6db34ae2f494db59b0e5d4ef8fa41f47500ded Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Thu, 5 Sep 2024 13:55:06 +0100 Subject: [PATCH] fix(developer): add doc comment to u16ltrim --- common/cpp/km_u16.cpp | 5 +++++ common/include/km_u16.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/common/cpp/km_u16.cpp b/common/cpp/km_u16.cpp index 0ae8bb6b6a..5bf33ebed8 100644 --- a/common/cpp/km_u16.cpp +++ b/common/cpp/km_u16.cpp @@ -389,6 +389,11 @@ double u16tof(KMX_WCHAR* str16) { return strtof(str.c_str(), &pEnd); } +/** + * @brief Trim whitespace from the start (left) of a string + * @param p Pointer to u16string + * @return Pointer to the first non-whitespace character in the string + */ const KMX_WCHAR* u16ltrim(const KMX_WCHAR* p) { while(p && iswspace(*p)) p++; return p; diff --git a/common/include/km_u16.h b/common/include/km_u16.h index 5ef92f31b5..32f18acb31 100644 --- a/common/include/km_u16.h +++ b/common/include/km_u16.h @@ -75,6 +75,8 @@ const KMX_WCHAR* u16rchr_slash(KMX_WCHAR const* Name); std::string toHex(int num1); +/** @brief Trim whitespace from the start (left) of a string */ const KMX_WCHAR* u16ltrim(const KMX_WCHAR* p); + KMX_WCHAR* u16rtrim(KMX_WCHAR *p); KMX_WCHAR* u16trim(KMX_WCHAR *p);