/////////////////////////////////////////////////////////////////////////////
// Name: string.h
-// Purpose: documentation for wxStringBuffer class
+// Purpose: interface of wxStringBuffer
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
};
+
/**
@class wxString
@wxheader{string.h}
@category{data}
@stdobjects
- Objects:
- wxEmptyString
+ ::Objects:, ::wxEmptyString,
- @seealso
- @ref overview_wxstringoverview "wxString overview", @ref overview_unicode
+ @see @ref overview_wxstringoverview "wxString overview", @ref overview_unicode
"Unicode overview"
*/
class wxString
Gets all the characters after the first occurrence of @e ch.
Returns the empty string if @a ch is not found.
*/
- wxString AfterFirst(wxChar ch);
+ wxString AfterFirst(wxChar ch) const;
/**
Gets all the characters after the last occurrence of @e ch.
Returns the whole string if @a ch is not found.
*/
- wxString AfterLast(wxChar ch);
+ wxString AfterLast(wxChar ch) const;
/**
Preallocate enough space for wxString to store @a nLen characters. This function
Gets all characters before the first occurrence of @e ch.
Returns the whole string if @a ch is not found.
*/
- wxString BeforeFirst(wxChar ch);
+ wxString BeforeFirst(wxChar ch) const;
/**
Gets all characters before the last occurrence of @e ch.
Returns the empty string if @a ch is not found.
*/
- wxString BeforeLast(wxChar ch);
+ wxString BeforeLast(wxChar ch) const;
/**
The MakeXXX() variants modify the string in place, while the other functions
This section also contains both implicit and explicit conversions to C style
strings. Although implicit conversion is quite convenient, it is advised to use
explicit @ref cstr() c_str method for the sake of clarity. Also
- see overview for the cases where it is necessary to
+ see overview() for the cases where it is necessary to
use it.
GetChar()
as the standard @e strcmp() function).
See also CmpNoCase(), IsSameAs().
*/
- int Cmp(const wxString& s);
- int Cmp(const wxChar* psz);
+ int Cmp(const wxString& s) const;
+ const int Cmp(const wxChar* psz) const;
//@}
//@{
as the standard @e strcmp() function).
See also Cmp(), IsSameAs().
*/
- int CmpNoCase(const wxString& s);
- int CmpNoCase(const wxChar* psz);
+ int CmpNoCase(const wxString& s) const;
+ const int CmpNoCase(const wxChar* psz) const;
//@}
/**
Case-sensitive comparison. Returns 0 if equal, 1 if greater or -1 if less.
This is a wxWidgets 1.xx compatibility function; use Cmp() instead.
*/
- int CompareTo(const wxChar* psz, caseCompare cmp = exact);
+ int CompareTo(const wxChar* psz, caseCompare cmp = exact) const;
/**
The default comparison function Cmp() is case-sensitive and
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- bool Contains(const wxString& str);
+ bool Contains(const wxString& str) const;
/**
The string provides functions for conversion to signed and unsigned integer and
@NULL. Otherwise, the function returns @false and doesn't
modify the @e rest.
*/
- bool EndsWith(const wxString& suffix, wxString rest = NULL);
+ bool EndsWith(const wxString& suffix, wxString rest = NULL) const;
//@{
/**
Searches for the given string. Returns the starting index, or @c wxNOT_FOUND if
not found.
*/
- int Find(wxUniChar ch, bool fromEnd = false);
- int Find(const wxString& sub);
+ int Find(wxUniChar ch, bool fromEnd = false) const;
+ const int Find(const wxString& sub) const;
//@}
//@{
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- int First(wxChar c);
- int First(const wxChar* psz);
- int First(const wxString& str);
+ int First(wxChar c) const;
+ int First(const wxChar* psz) const;
+ const int First(const wxString& str) const;
//@}
/**
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- int Freq(wxChar ch);
+ int Freq(wxChar ch) const;
//@{
/**
build, the string is interpreted as being in ISO-8859-1 encoding. The version
without @a len parameter takes NUL-terminated data.
This is a convenience method useful when storing binary data in wxString.
- This function is new since wxWidgets version 2.8.4
+
+ @wxsince{2.8.4}
@see wxString::To8BitData
*/
/**
Returns the character at position @a n (read-only).
*/
- wxChar GetChar(size_t n);
+ wxChar GetChar(size_t n) const;
/**
wxWidgets compatibility conversion. Returns a constant pointer to the data in
the string.
*/
- const wxChar* GetData();
+ const wxChar* GetData() const;
/**
Returns a reference to the character at position @e n.
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- size_t Index(wxChar ch);
- size_t Index(const wxChar* sz);
+ size_t Index(wxChar ch) const;
+ const size_t Index(const wxChar* sz) const;
//@}
/**
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- bool IsAscii();
+ bool IsAscii() const;
/**
Returns @true if the string is empty.
*/
- bool IsEmpty();
+ bool IsEmpty() const;
/**
Returns @true if the string is empty (same as wxString::IsEmpty).
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- bool IsNull();
+ bool IsNull() const;
/**
Returns @true if the string is an integer (with possible sign).
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- bool IsNumber();
+ bool IsNumber() const;
//@{
/**
Returns @true if the string is equal to the character, @false otherwise.
See also Cmp(), CmpNoCase()
*/
- bool IsSameAs(const wxChar* psz, bool caseSensitive = true);
- bool IsSameAs(wxChar c, bool caseSensitive = true);
+ bool IsSameAs(const wxChar* psz, bool caseSensitive = true) const;
+ const bool IsSameAs(wxChar c, bool caseSensitive = true) const;
//@}
/**
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- bool IsWord();
+ bool IsWord() const;
//@{
/**
code.
*/
wxChar Last();
- wxChar Last();
+ const wxChar Last();
//@}
/**
Returns the first @a count characters of the string.
*/
- wxString Left(size_t count);
+ wxString Left(size_t count) const;
/**
Returns the length of the string.
*/
- size_t Len();
+ size_t Len() const;
/**
Returns the length of the string (same as Len).
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- size_t Length();
+ size_t Length() const;
/**
Returns this string converted to the lower case.
*/
- wxString Lower();
+ wxString Lower() const;
/**
Same as MakeLower.
/**
Returns @true if the string contents matches a mask containing '*' and '?'.
*/
- bool Matches(const wxString& mask);
+ bool Matches(const wxString& mask) const;
/**
These are "advanced" functions and they will be needed quite rarely.
Returns a substring starting at @e first, with length @e count, or the rest of
the string if @a count is the default value.
*/
- wxString Mid(size_t first, size_t count = wxSTRING_MAXLEN);
+ wxString Mid(size_t first, size_t count = wxSTRING_MAXLEN) const;
/**
Other string functions.
/**
Returns the last @a count characters.
*/
- wxString Right(size_t count);
+ wxString Right(size_t count) const;
/**
These functions replace the standard @e strchr() and @e strstr()
@NULL. Otherwise, the function returns @false and doesn't modify the
@e rest.
*/
- bool StartsWith(const wxString& prefix, wxString rest = NULL);
+ bool StartsWith(const wxString& prefix, wxString rest = NULL) const;
/**
These functions return the string length and check whether the string is empty
This is a wxWidgets 1.xx compatibility function; you should not use it in new
code.
*/
- wxString Strip(stripType s = trailing);
+ wxString Strip(stripType s = trailing) const;
/**
Returns the part of the string between the indices @a from and @e to
This is a wxWidgets 1.xx compatibility function, use Mid()
instead (but note that parameters have different meaning).
*/
- wxString SubString(size_t from, size_t to);
+ wxString SubString(size_t from, size_t to) const;
/**
These functions allow to extract substring from this string. All of them don't
Converts the string to an 8-bit string in ISO-8859-1 encoding in the form of
a wxCharBuffer (Unicode builds only).
This is a convenience method useful when storing binary data in wxString.
- This function is new since wxWidgets version 2.8.4
+
+ @wxsince{2.8.4}
@see wxString::From8BitData
*/
- const char* To8BitData();
- const wxCharBuffer To8BitData();
+ const char* To8BitData() const;
+ const const wxCharBuffer To8BitData() const;
//@}
//@{
characters. The @ref mbstr() mb_str method provides more
powerful means of converting wxString to C string.
*/
- const char* ToAscii();
- const wxCharBuffer ToAscii();
+ const char* ToAscii() const;
+ const const wxCharBuffer ToAscii() const;
//@}
/**
@see ToLong(), ToULong()
*/
- bool ToDouble(double val);
+ bool ToDouble(double val) const;
/**
Attempts to convert the string to a signed integer in base @e base. Returns
@see ToDouble(), ToULong()
*/
- bool ToLong(long val, int base = 10);
+ bool ToLong(long val, int base = 10) const;
/**
This is exactly the same as ToLong() but works with 64
@see ToLong(), ToULongLong()
*/
- bool ToLongLong(wxLongLong_t val, int base = 10);
+ bool ToLongLong(wxLongLong_t val, int base = 10) const;
/**
Attempts to convert the string to an unsigned integer in base @e base.
@see ToDouble(), ToLong()
*/
- bool ToULong(unsigned long val, int base = 10);
+ bool ToULong(unsigned long val, int base = 10) const;
/**
This is exactly the same as ToULong() but works with 64
bit integer numbers.
Please see ToLongLong() for additional remarks.
*/
- bool ToULongLong(wxULongLong_t val, int base = 10);
+ bool ToULongLong(wxULongLong_t val, int base = 10) const;
//@{
/**
Same as @ref wxString::utf8str utf8_str.
*/
- const char* ToUTF8();
- const wxCharBuffer ToUF8();
+ const char* ToUTF8() const;
+ const const wxCharBuffer ToUF8() const;
//@}
/**
/**
Returns this string converted to upper case.
*/
- wxString Upper();
+ wxString Upper() const;
/**
The same as MakeUpper.
fnstr() fn_str, @ref charstr() char_str, @ref
wcharstr() wchar_string
*/
- const wxChar* c_str();
+ const wxChar* c_str() const;
/**
Returns an object with string data that is implicitly convertible to
fnstr() fn_str, @ref cstr() c_str, @ref
wcharstr() wchar_str
*/
- wxWritableCharBuffer char_str(const wxMBConv& conv = wxConvLibc);
+ wxWritableCharBuffer char_str(const wxMBConv& conv = wxConvLibc) const;
//@{
/**
@see wxMBConv, @ref wcstr() wc_str, @ref wcstr() mb_str
*/
- const wchar_t* fn_str();
- const char* fn_str();
- const wxCharBuffer fn_str();
+ const wchar_t* fn_str() const;
+ const const char* fn_str() const;
+ const const wxCharBuffer fn_str() const;
//@}
//@{
@see wxMBConv, @ref cstr() c_str, @ref wcstr() wc_str, @ref
fnstr() fn_str, @ref charstr() char_str
*/
- const char* mb_str(const wxMBConv& conv = wxConvLibc);
- const wxCharBuffer mb_str(const wxMBConv& conv = wxConvLibc);
+ const char* mb_str(const wxMBConv& conv = wxConvLibc) const;
+ const const wxCharBuffer mb_str(const wxMBConv& conv = wxConvLibc) const;
//@}
/**
/**
Element extraction.
*/
- wxChar operator [](size_t i);
- wxChar operator [](size_t i);
- wxChar operator [](int i);
- wxChar operator [](int i);
+ wxChar operator [](size_t i) const;
+ wxChar operator [](size_t i) const;
+ const wxChar operator [](int i) const;
+ wxChar operator [](int i) const;
//@}
/**
Implicit conversion to a C string.
*/
- operator const wxChar*();
+ operator const wxChar*() const;
/**
Empty string is @false, so !string will only return @true if the string is
to wxString.
See also IsEmpty().
*/
- bool operator!();
+ bool operator!() const;
/**
The supported functions are only listed here, please see any STL reference for
wxCharBuffer object or as a pointer to the internal string contents in
UTF-8 build.
*/
- const char* utf8_str();
- const wxCharBuffer utf8_str();
+ const char* utf8_str() const;
+ const const wxCharBuffer utf8_str() const;
//@}
//@{
@see wxMBConv, @ref cstr() c_str, @ref wcstr() mb_str, @ref
fnstr() fn_str, @ref wcharstr() wchar_str
*/
- const wchar_t* wc_str(const wxMBConv& conv);
- const wxWCharBuffer wc_str(const wxMBConv& conv);
+ const wchar_t* wc_str(const wxMBConv& conv) const;
+ const const wxWCharBuffer wc_str(const wxMBConv& conv) const;
//@}
/**
fnstr() fn_str, @ref cstr() c_str, @ref
charstr() char_str
*/
- wxWritableWCharBuffer wchar_str();
+ wxWritableWCharBuffer wchar_str() const;
/**
These functions are deprecated, please consider using new wxWidgets 2.0
};
+/**
+ FIXME
+*/
+wxString Objects:
+;
+
+/**
+ FIXME
+*/
+wxString wxEmptyString;
+
+
+
+
/**
@class wxStringBufferLength
@wxheader{string.h}
};
+
// ============================================================================
// Global functions/macros
// ============================================================================
//@{
/**
Converts its argument to string.
- See also: wxFromString.
+ See also: wxFromString().
*/
wxString wxToString(const wxColour& col);
wxString wxToString(const wxFont& col);
//@{
/**
Converts string to the type of the second argument. Returns @true on success.
- See also: wxToString.
+ See also: wxToString().
*/
bool wxFromString(const wxString& str, wxColour* col);
bool wxFromString(const wxString& str, wxFont* col);