From 743a66abe3412f9425c7ad137532bba9492b8067 Mon Sep 17 00:00:00 2001 From: Jan Fellner Date: Mon, 15 Dec 2025 15:02:33 +0100 Subject: [PATCH 1/2] BUILDSYS-568 Replaced setters for strings from std::string/std::wstring and const char* / const wchar_t* to std::string_view and std::wstring_view --- cpp-lib/include/asn-incl.h | 12 +++--------- cpp-lib/src/asn-stringtype.cpp | 25 +++++-------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/cpp-lib/include/asn-incl.h b/cpp-lib/include/asn-incl.h index 8aa1bc4..ec9d4b8 100644 --- a/cpp-lib/include/asn-incl.h +++ b/cpp-lib/include/asn-incl.h @@ -1926,27 +1926,21 @@ class SNACCDLL_API WideAsnString : public std::wstring, public AsnType, protecte WideAsnString(const std::wstring& strUTF16); // Set the string as ASCII string (the internal encoding to and from other encodings wil be ISO-8859-1) - void setASCII(const char* strAscii); - // Set the string as ASCII string (the internal encoding to and from other encodings wil be ISO-8859-1) - void setASCII(const std::string& strAscii); + void setASCII(std::string_view strAscii); // Get the string as ASCII string (the internal encoding to and from other encodings wil be ISO-8859-1) std::string getASCII() const; // Get the string as ASCII string (the internal encoding to and from other encodings wil be ISO-8859-1) void getASCII(std::string& strAscii) const; // Set the string as UTF8 string - void setUTF8(const char* szUTF8); - // Set the string as UTF8 string - void setUTF8(const std::string& strUTF8); + void setUTF8(std::string_view strUTF8); // Get the string as UTF8 string std::string getUTF8() const; // Get the string as UTF8 string void getUTF8(std::string& strUTF8) const; // Set the string as UTF16 (= Windows Unicode) string - void setUTF16(const wchar_t* szUTF16); - // Set the string as UTF16 (= Windows Unicode) string - void setUTF16(const std::wstring& strUTF16); + void setUTF16(std::wstring_view strUTF16); // Get the string as UTF16 (= Windows Unicode) string std::wstring getUTF16() const; // Get the string as UTF16 (= Windows Unicode) string diff --git a/cpp-lib/src/asn-stringtype.cpp b/cpp-lib/src/asn-stringtype.cpp index e7c352d..b9ebadb 100644 --- a/cpp-lib/src/asn-stringtype.cpp +++ b/cpp-lib/src/asn-stringtype.cpp @@ -564,14 +564,9 @@ WideAsnString::WideAsnString(const std::string& strASCII) setASCII(strASCII.c_str()); } -void WideAsnString::setASCII(const char* strAscii) +void WideAsnString::setASCII(std::string_view strAscii) { - assign(AsnStringConvert::AsciiToUTF16(strAscii)); -} - -void WideAsnString::setASCII(const std::string& strAscii) -{ - assign(AsnStringConvert::AsciiToUTF16(strAscii.c_str())); + assign(AsnStringConvert::AsciiToUTF16(strAscii.data())); } std::string WideAsnString::getASCII() const @@ -584,14 +579,9 @@ void WideAsnString::getASCII(std::string& strAscii) const strAscii = AsnStringConvert::UTF16ToAscii(c_str()); } -void WideAsnString::setUTF8(const char* szUTF8) +void WideAsnString::setUTF8(std::string_view strUTF8) { - assign(AsnStringConvert::UTF8ToUTF16(szUTF8)); -} - -void WideAsnString::setUTF8(const std::string& strUTF8) -{ - assign(AsnStringConvert::UTF8ToUTF16(strUTF8.c_str())); + assign(AsnStringConvert::UTF8ToUTF16(strUTF8.data())); } std::string WideAsnString::getUTF8() const @@ -604,12 +594,7 @@ void WideAsnString::getUTF8(std::string& strUTF8) const strUTF8 = AsnStringConvert::UTF16ToUTF8(c_str()); } -void WideAsnString::setUTF16(const wchar_t* szUTF16) -{ - assign(szUTF16); -} - -void WideAsnString::setUTF16(const std::wstring& strUTF16) +void WideAsnString::setUTF16(std::wstring_view strUTF16) { assign(strUTF16); } From eb2cb3f1ac7a5e93efbee0223d81838c869a5f97 Mon Sep 17 00:00:00 2001 From: Jan Fellner Date: Mon, 15 Dec 2025 15:03:52 +0100 Subject: [PATCH 2/2] BUILDSYS-568 bumped version to 6.0.35 --- version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/version.h b/version.h index d46e09e..b55dfd3 100644 --- a/version.h +++ b/version.h @@ -1,8 +1,8 @@ #ifndef VERSION_H #define VERSION_H -#define VERSION "6.0.34" -#define VERSION_RC 6, 0, 34 -#define RELDATE "02.12.2025" +#define VERSION "6.0.35" +#define VERSION_RC 6, 0, 35 +#define RELDATE "15.12.2025" #endif // VERSION_H