/////////////////////////////////////////////////////////////////////////////
// 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
wxMBConv::MB2WC method is called to
convert @a psz to wide string (the default converter uses current locale's
charset). It is ignored in ANSI build.
-
+
@see @ref overview_mbconvclasses "wxMBConv classes", @ref mbstr()
mb_str, @ref wcstr() wc_str
*/
Preallocate enough space for wxString to store @a nLen characters. This function
may be used to increase speed when the string is constructed by repeated
concatenation as in
-
+
because it will avoid the need to reallocate string memory many times (in case
of long strings). Note that it does not set the maximal length of a string - it
will still expand if more than @a nLen characters are stored in it. Also, it
return a new string which contains the original text converted to the upper or
lower case and leave the original string unchanged.
MakeUpper()
-
+
Upper()
-
+
MakeLower()
-
+
Lower()
*/
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()
-
+
GetWritableChar()
-
+
SetChar()
-
+
Last()
-
+
@ref operatorbracket() "operator []"
-
+
@ref cstr() c_str
-
+
@ref mbstr() mb_str
-
+
@ref wcstr() wc_str
-
+
@ref fnstr() fn_str
-
+
@ref operatorconstcharpt() "operator const char*"
*/
doing direct string comparison as you would also have to precalculate the
length of the prefix then.
Cmp()
-
+
CmpNoCase()
-
+
IsSameAs()
-
+
Matches()
-
+
StartsWith()
-
+
EndsWith()
*/
//@{
/**
-
+
*/
bool operator ==(const wxString& x, const wxString& y);
bool operator ==(const wxString& x, const wxChar* t);
append something to a C string (including literal constants), so to do this it
should be converted to a wxString first.
@ref operatorout() "operator "
-
+
@ref plusequal() "operator +="
-
+
@ref operatorplus() "operator +"
-
+
Append()
-
+
Prepend()
*/
default which creates an empty string) there is also a corresponding assignment
operator.
@ref construct() wxString
-
+
@ref operatorassign() "operator ="
-
+
@ref destruct() ~wxString
*/
put the numeric value in and return @true if the @b entire string could be
converted to a number.
ToLong()
-
+
ToLongLong()
-
+
ToULong()
-
+
ToULongLong()
-
+
ToDouble()
*/
/**
This static function returns the string containing the result of calling
Printf() with the passed parameters on it.
-
+
@see FormatV(), Printf()
*/
static wxString Format(const wxChar format, ...);
/**
This static function returns the string containing the result of calling
PrintfV() with the passed parameters on it.
-
+
@see Format(), PrintfV()
*/
static wxString FormatV(const wxChar format, va_list argptr);
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
*/
static wxString From8BitData(const char* buf, size_t len);
useful when working with some external API which requires the caller to provide
a writable buffer.
Alloc()
-
+
Shrink()
-
+
wxStringBuffer
-
+
wxStringBufferLength
*/
/**
Other string functions.
Trim()
-
+
Truncate()
-
+
Pad()
*/
characters written, or an integer less than zero on error.
Note that if @c wxUSE_PRINTF_POS_PARAMS is set to 1, then this function supports
Unix98-style positional parameters:
-
+
@b NB: This function will use a safe version of @e vsprintf() (usually called
@e vsnprintf()) whenever available to always allocate the buffer of correct
size. Unfortunately, this function is not available on all platforms and the
These functions replace the standard @e strchr() and @e strstr()
functions.
Find()
-
+
Replace()
*/
These functions return the string length and check whether the string is empty
or empty it.
Len()
-
+
IsEmpty()
-
+
@ref operatornot() operator!
-
+
Empty()
-
+
Clear()
*/
modify the original string and return a new string containing the extracted
substring.
Mid()
-
+
@ref operatorparenth() operator
-
+
Left()
-
+
Right()
-
+
BeforeFirst()
-
+
BeforeLast()
-
+
AfterFirst()
-
+
AfterLast()
-
+
StartsWith()
-
+
EndsWith()
*/
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;
success (the number is stored in the location pointed to by @e val) or @false
if the string does not represent such number (the value of @a val is not
modified in this case).
-
+
@see ToLong(), ToULong()
*/
bool ToDouble(double val) const;
that you may not want to specify the base 0 if you are parsing the numbers
which may have leading zeroes as they can yield unexpected (to the user not
familiar with C) results.
-
+
@see ToDouble(), ToULong()
*/
bool ToLong(long val, int base = 10) const;
Notice that currently it doesn't work (always returns @false) if parsing of 64
bit numbers is not supported by the underlying C run-time library. Compilers
with C99 support and Microsoft Visual C++ version 7 and higher do support this.
-
+
@see ToLong(), ToULongLong()
*/
bool ToLongLong(wxLongLong_t val, int base = 10) const;
(e.g. -1 is returned as @c ULONG_MAX).
See ToLong() for the more detailed
description of the @a base parameter.
-
+
@see ToDouble(), ToLong()
*/
bool ToULong(unsigned long val, int base = 10) const;
insertion operators exist (for basic types only). Additionally, the
Format() function allows to use simply append
formatted value to a string:
-
+
Format()
-
+
FormatV()
-
+
Printf()
-
+
PrintfV()
-
+
@ref operatorout() "operator "
*/
@c wchar_t*, use @ref charstr() char_str or
@ref wcharstr() wchar_string if you need to pass string value
to a function expecting non-const pointer.
-
+
@see @ref mbstr() mb_str, @ref wcstr() wc_str, @ref
fnstr() fn_str, @ref charstr() char_str, @ref
wcharstr() wchar_string
this function is only usable for passing strings to legacy libraries that
don't have const-correct API. Use wxStringBuffer if
you want to modify the string.
-
+
@see @ref mbstr() mb_str, @ref wcstr() wc_str, @ref
fnstr() fn_str, @ref cstr() c_str, @ref
wcharstr() wchar_str
In Unicode build, returned value can be either wide character string
or C string in charset matching the @c wxConvFileName object, depending on
the OS.
-
+
@see wxMBConv, @ref wcstr() wc_str, @ref wcstr() mb_str
*/
const wchar_t* fn_str() const;
method and returns wxCharBuffer. In ANSI build, this function is same
as @ref cstr() c_str.
The macro wxWX2MBbuf is defined as the correct return type (without const).
-
+
@see wxMBConv, @ref cstr() c_str, @ref wcstr() wc_str, @ref
fnstr() fn_str, @ref charstr() char_str
*/
method and returns wxWCharBuffer. In Unicode build, this function is same
as @ref cstr() c_str.
The macro wxWX2WCbuf is defined as the correct return type (without const).
-
+
@see wxMBConv, @ref cstr() c_str, @ref wcstr() mb_str, @ref
fnstr() fn_str, @ref wcharstr() wchar_str
*/
not be lost (depending on the build) and so this function is only usable for
passing strings to legacy libraries that don't have const-correct API. Use
wxStringBuffer if you want to modify the string.
-
+
@see @ref mbstr() mb_str, @ref wcstr() wc_str, @ref
fnstr() fn_str, @ref cstr() c_str, @ref
charstr() char_str
These functions are deprecated, please consider using new wxWidgets 2.0
functions instead of them (or, even better, std::string compatible variants).
CompareTo()
-
+
Contains()
-
+
First()
-
+
Freq()
-
+
Index()
-
+
IsAscii()
-
+
IsNull()
-
+
IsNumber()
-
+
IsWord()
-
+
Last()
-
+
Length()
-
+
LowerCase()
-
+
Remove()
-
+
Strip()
-
+
SubString()
-
+
UpperCase()
*/
};
+/**
+ 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);