X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4cc4bfafe5a31cb96f35b3ec9b19fa2b0b3a4eef..511a9e3a471a365cea9da2f9f25903f542f95853:/interface/regex.h diff --git a/interface/regex.h b/interface/regex.h index be39e63ae7..68db15b112 100644 --- a/interface/regex.h +++ b/interface/regex.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: regex.h -// Purpose: documentation for wxRegEx class +// Purpose: interface of wxRegEx // Author: wxWidgets team // RCS-ID: $Id$ // Licence: wxWindows license @@ -21,7 +21,7 @@ Regular expressions, as defined by POSIX, come in two flavours: @e extended and @e basic. The builtin library also adds a third flavour - of expression advanced, which is not available + of expression advanced(), which is not available when using the system library. Unicode is fully supported only when using the builtin library. @@ -37,8 +37,7 @@ @library{wxbase} @category{data} - @seealso - wxRegEx::ReplaceFirst + @see wxRegEx::ReplaceFirst */ class wxRegEx { @@ -71,9 +70,11 @@ public: and only if @c wxRE_NOSUB was @b not used in Compile(). */ - bool GetMatch(size_t* start, size_t* len, size_t index = 0); - not wxString GetMatch(const wxString& text, - size_t index = 0); + bool GetMatch(size_t* start, size_t* len, size_t index = 0) const; + const not used in + Compile(). + Returns false if no match or if an error occurred. + wxString GetMatch(const wxString& text, size_t index = 0) const; //@} /** @@ -82,13 +83,13 @@ public: May only be called after successful call to Compile(). and only if @c wxRE_NOSUB was @b not used. */ - size_t GetMatchCount(); + size_t GetMatchCount() const; /** Return @true if this is a valid compiled regular expression, @false otherwise. */ - bool IsValid(); + bool IsValid() const; //@{ /** @@ -105,9 +106,9 @@ public: possible to avoid a @e wxStrlen() inside the loop. May only be called after successful call to Compile(). */ - bool Matches(const wxChar* text, int flags = 0); - bool Matches(const wxChar* text, int flags, size_t len); - bool Matches(const wxString& text, int flags = 0); + bool Matches(const wxChar* text, int flags = 0) const; + const bool Matches(const wxChar* text, int flags, size_t len) const; + const bool Matches(const wxString& text, int flags = 0) const; //@} /** @@ -123,18 +124,19 @@ public: pattern in the text while default value of 0 means replace all. */ int Replace(wxString* text, const wxString& replacement, - size_t maxMatches = 0); + size_t maxMatches = 0) const; /** Replace all occurrences: this is actually a synonym for Replace(). - + @see ReplaceFirst() */ - int ReplaceAll(wxString* text, const wxString& replacement); + int ReplaceAll(wxString* text, const wxString& replacement) const; /** Replace the first occurrence. */ - int ReplaceFirst(wxString* text, const wxString& replacement); + int ReplaceFirst(wxString* text, const wxString& replacement) const; }; +