// Purpose: interface of wxStringBuffer, wxString
// Author: wxWidgets team
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@see wxString::From8BitData()
*/
- const char* To8BitData() const;
-
- /**
- @overload
- */
- const wxCharBuffer To8BitData() const;
+ const wxScopedCharBuffer To8BitData() const;
/**
Converts the string to an ASCII, 7-bit string in the form of
/**
Gets all characters before the first occurrence of @e ch.
Returns the whole string if @a ch is not found.
+
+ @param ch The character to look for.
+ @param rest Filled with the part of the string following the first
+ occurrence of @a ch or cleared if it was not found. The same string
+ is returned by AfterFirst() but it is more efficient to use this
+ output parameter if both the "before" and "after" parts are needed
+ than calling both functions one after the other. This parameter is
+ available in wxWidgets version 2.9.2 and later only.
+ @return Part of the string before the first occurrence of @a ch.
*/
- wxString BeforeFirst(wxUniChar ch) const;
+ wxString BeforeFirst(wxUniChar ch, wxString *rest = NULL) const;
/**
Gets all characters before the last occurrence of @e ch.
Returns the empty string if @a ch is not found.
+
+ @param ch The character to look for.
+ @param rest Filled with the part of the string following the last
+ occurrence of @a ch or the copy of this string if it was not found.
+ The same string is returned by AfterLast() but it is more efficient
+ to use this output parameter if both the "before" and "after" parts
+ are needed than calling both functions one after the other. This
+ parameter is available in wxWidgets version 2.9.2 and later only.
+ @return Part of the string before the last occurrence of @a ch.
*/
- wxString BeforeLast(wxUniChar ch) const;
+ wxString BeforeLast(wxUniChar ch, wxString *rest = NULL) const;
//@}
static wxString FromAscii(char c);
//@}
+ /**
+ Returns a string with the textual representation of the number in C
+ locale.
+
+ Unlike FromDouble() the string returned by this function always uses
+ the period character as decimal separator, independently of the current
+ locale.
+
+ @since 2.9.1
+
+ @see ToCDouble()
+ */
+ static wxString FromCDouble(double val);
+
+ /**
+ Returns a string with the textual representation of the number.
+
+ This is a simple wrapper for @code wxString::Format("%g", val)
+ @endcode.
+
+ Notice that the string returned by this function uses the decimal
+ separator appropriate for the current locale, e.g. @c "," and not a
+ period in French locale. Use FromCDouble() if this is unwanted.
+
+ @since 2.9.1
+
+ @see ToDouble()
+ */
+ static wxString FromDouble(double val);
+
//@{
/**
Converts C string encoded in UTF-8 to wxString.