From 55d77f271ec65772b3b136e84bac99237499dd70 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Fri, 25 Mar 2016 10:40:58 +0200 Subject: [PATCH] Don't call different variants of wxString methods overloads The function such as fn_str(), wc_str(), and ToAscii() have configuration-dependent return types, yet different variants were claimed to be member function overloads. This is incorrect, as a member function cannot be overloaded only by its return type and, for any given platform/build variant only one of them is available. Closes https://github.com/wxWidgets/wxWidgets/pull/260 --- interface/wx/string.h | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/interface/wx/string.h b/interface/wx/string.h index 0b12290ab9..2e2e91e651 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -656,18 +656,11 @@ public: /** Returns a string representation suitable for passing to OS' functions for file handling. - */ - const wchar_t* fn_str() const; - /** - @overload + Depending on OS and configuration, TYPE is either @c wchar_t*, + @c char*, or wxCharBuffer. */ - const char* fn_str() const; - - /** - @overload - */ - const wxCharBuffer fn_str() const; + const TYPE fn_str() const; /** Returns the multibyte (C string) representation of the string @@ -692,16 +685,14 @@ public: or returns a pointer to the internal string contents in wide character mode (Windows). + Depending on OS and configuration, TYPE is either @c wchar_t* + or wxCharBuffer. + The macro wxWX2WCbuf is defined as the correct return type (without const). @see utf8_str(), c_str(), mb_str(), fn_str(), wchar_str() */ - const wchar_t* wc_str() const; - - /** - @overload - */ - const wxWCharBuffer wc_str() const; + const TYPE wc_str() const; /** Returns an object with string data that is implicitly convertible to @@ -744,16 +735,14 @@ public: Use mb_str() or utf8_str() to convert to other encodings. + Depending on OS and configuration, TYPE is either @c char* or + wxCharBuffer. + @param replaceWith The character used to replace any non-ASCII characters, default to underscore (@c "_"). This parameter is new since wxWidgets 3.1.0. */ - const char* ToAscii(char replaceWith = '_') const; - - /** - @overload - */ - const wxCharBuffer ToAscii(char replaceWith = '_') const; + const TYPE ToAscii(char replaceWith = '_') const; /** Return the string as an std::string in current locale encoding.