From 3b473f7a67a8feb694856dd705454fdb9945b319 Mon Sep 17 00:00:00 2001 From: madmaxoft <github@xoft.cz> Date: Sat, 28 Sep 2013 19:28:19 +0200 Subject: Added URLDecode() and ReplaceAllCharOccurrences() to StringUtils. --- source/StringUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/StringUtils.h') diff --git a/source/StringUtils.h b/source/StringUtils.h index 211799e91..929e6fd5b 100644 --- a/source/StringUtils.h +++ b/source/StringUtils.h @@ -72,6 +72,12 @@ extern AString EscapeString(const AString & a_Message); // tolua_export /// Removes all control codes used by MC for colors and styles extern AString StripColorCodes(const AString & a_Message); // tolua_export +/// URL-Decodes the given string, replacing all "%HH" into the correct characters. Invalid % sequences are left intact +extern AString URLDecode(const AString & a_String); // Cannot export to Lua automatically - would generated an extra return value + +/// Replaces all occurrences of char a_From inside a_String with char a_To. +extern AString ReplaceAllCharOccurrences(const AString & a_String, char a_From, char a_To); // Needn't export to Lua, since Lua doesn't have chars anyway + // If you have any other string helper functions, declare them here -- cgit v1.2.3 From e31343297ee648c799a4d30b578259719f21ede5 Mon Sep 17 00:00:00 2001 From: madmaxoft <github@xoft.cz> Date: Mon, 30 Sep 2013 19:59:40 +0200 Subject: Added StrToLower(), URLDecode() and ReplaceAllCharOccurrences(). --- source/StringUtils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/StringUtils.h') diff --git a/source/StringUtils.h b/source/StringUtils.h index 929e6fd5b..e35e58c9f 100644 --- a/source/StringUtils.h +++ b/source/StringUtils.h @@ -45,6 +45,9 @@ extern AString TrimString(const AString & str); // tolua_export /// In-place string conversion to uppercase; returns the same string extern AString & StrToUpper(AString & s); +/// In-place string conversion to lowercase; returns the same string +extern AString & StrToLower(AString & s); + /// Case-insensitive string comparison; returns 0 if the strings are the same extern int NoCaseCompare(const AString & s1, const AString & s2); // tolua_export -- cgit v1.2.3 From db3d83b38dd61b90466a0721fa9104e742f3fb8b Mon Sep 17 00:00:00 2001 From: madmaxoft <github@xoft.cz> Date: Fri, 4 Oct 2013 20:28:30 +0200 Subject: Added Basic auth support to cHTTPRequest. --- source/StringUtils.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/StringUtils.h') diff --git a/source/StringUtils.h b/source/StringUtils.h index e35e58c9f..ec9ba96ce 100644 --- a/source/StringUtils.h +++ b/source/StringUtils.h @@ -81,6 +81,9 @@ extern AString URLDecode(const AString & a_String); // Cannot export to Lua aut /// Replaces all occurrences of char a_From inside a_String with char a_To. extern AString ReplaceAllCharOccurrences(const AString & a_String, char a_From, char a_To); // Needn't export to Lua, since Lua doesn't have chars anyway +/// Decodes a Base64-encoded string into the raw data +extern AString Base64Decode(const AString & a_Base64String); + // If you have any other string helper functions, declare them here -- cgit v1.2.3