Add C++20-style starts_with()/ends_with() functions to wxString

C++20 introduces these two functions, along with some overloads, to
std::string. Add similar functions to wxString, which simply call the
already existing StartsWith() and EndsWith().

Closes https://github.com/wxWidgets/wxWidgets/pull/1452
This commit is contained in:
Lauri Nurmi
2019-07-30 10:01:24 +03:00
committed by Vadim Zeitlin
parent a8c4cbee09
commit 4739b9dedd
3 changed files with 46 additions and 0 deletions

View File

@@ -1711,6 +1711,14 @@ public:
wxString substr(size_t nStart = 0, size_t nLen = npos) const;
void swap(wxString& str);
bool starts_with(const wxString &str) const;
bool starts_with(const char *sz) const;
bool starts_with(const wchar_t *sz) const;
bool ends_with(const wxString &str) const;
bool ends_with(const char *sz) const;
bool ends_with(const wchar_t *sz) const;
//@}