X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8162b8489765fbc579b9f60f229265ca1bfd8ab0..61714c237d73406dc863573f79f9007e60d94aba:/docs/latex/wx/wxstring.tex diff --git a/docs/latex/wx/wxstring.tex b/docs/latex/wx/wxstring.tex index 092f1eccee..9c82d7fb3e 100644 --- a/docs/latex/wx/wxstring.tex +++ b/docs/latex/wx/wxstring.tex @@ -138,11 +138,36 @@ functions. \helpref{Find}{wxstringfind}\\ \helpref{Replace}{wxstringreplace} +\membersection{Conversion to numbers} + +The string provides functions for conversion to signed and unsigned integer and +floating point numbers. All three functions take a pointer to the variable to +put the numeric value in and return TRUE if the {\bf entire} string could be +converted to a number. + +\helpref{ToLong}{wxstringtolong}\\ +\helpref{ToULong}{wxstringtoulong}\\ +\helpref{ToDouble}{wxstringtodouble} + \membersection{Writing values into the string} Both formatted versions (\helpref{Printf}{wxstringprintf}) and stream-like -insertion operators exist (for basic types only). +insertion operators exist (for basic types only). Additionally, the +\helpref{Format}{wxstringformat} function allows to use simply append +formatted value to a string: + +\begin{verbatim} + // the following 2 snippets are equivalent + wxString s = "..."; + s += wxString::Format("%d", n); + + wxString s; + s.Printf("...%d", n); +\end{verbatim} + +\helpref{Format}{wxstringformat}\\ +\helpref{FormatV}{wxstringformatv}\\ \helpref{Printf}{wxstringprintf}\\ \helpref{PrintfV}{wxstringprintfv}\\ \helpref{operator \cinsert}{wxstringoperatorout} @@ -548,6 +573,28 @@ Searches for the given string. Returns the starting index, or -1 if not found. Returns the first occurrence of the item. +\membersection{wxString::Format}\label{wxstringformat} + +\func{static wxString}{Format}{\param{const wxChar }{*format}, \param{}{...}} + +This static function returns the string containing the result of calling +\helpref{Printf}{wxstringprintf} with the passed parameters on it. + +\wxheading{See also} + +\helpref{FormatV}{wxstringformatv}, \helpref{Printf}{wxstringprintf} + +\membersection{wxString::FormatV}\label{wxstringformatv} + +\func{static wxString}{Format}{\param{const wxChar }{*format}, \param{va\_list }{argptr}} + +This static function returns the string containing the result of calling +\helpref{PrintfV}{wxstringprintfv} with the passed parameters on it. + +\wxheading{See also} + +\helpref{Format}{wxstringformat}, \helpref{PrintfV}{wxstringprintfv} + \membersection{wxString::Freq}\label{wxstringfreq} \constfunc{int}{Frec}{\param{char }{ch}} @@ -642,7 +689,18 @@ caseSensitive is TRUE by default (case matters). Returns TRUE if strings are equal, FALSE otherwise. -See also \helpref{Cmp}{wxstringcmp}, \helpref{CmpNoCase}{wxstringcmpnocase}. +See also \helpref{Cmp}{wxstringcmp}, \helpref{CmpNoCase}{wxstringcmpnocase}, \helpref{IsSameAs}{wxstringissameas2} + +\membersection{wxString::IsSameAs}\label{wxstringissameas2} + +\constfunc{bool}{IsSameAs}{\param{char}{ c}, \param{bool}{ caseSensitive = TRUE}} + +Test whether the string is equal to the single character {\it c}. The test is +case-sensitive if {\it caseSensitive} is TRUE (default) or not if it is FALSE. + +Returns TRUE if the string is equal to the character, FALSE otherwise. + +See also \helpref{Cmp}{wxstringcmp}, \helpref{CmpNoCase}{wxstringcmpnocase}, \helpref{IsSameAs}{wxstringissameas} \membersection{wxString::IsWord}\label{wxstringisword} @@ -761,7 +819,7 @@ Same as Truncate. Removes the portion from {\it pos} to the end of the string. \func{wxString\&}{Remove}{\param{size\_t}{ pos}, \param{size\_t}{ len}} -Removes the last {\it len} characters from the string, starting at {\it pos}. +Removes the {\it len} characters from the string, starting at {\it pos}. \membersection{wxString::RemoveLast}\label{wxstringremovelast} @@ -821,6 +879,30 @@ doesn't change this string. Same as \helpref{Mid}{wxstringmid}. +\membersection{wxString::ToDouble}\label{wxstringtodouble} + +\constfunc{bool}{To}{\param{double}{ *val}} + +Attempts to convert the string to a floating point number. Returns TRUE on +suceess (the number is stored in the location pointed to by {\it val}) or FALSE +if the string does not represent such number. + +\membersection{wxString::ToLong}\label{wxstringtolong} + +\constfunc{bool}{To}{\param{long}{ *val}} + +Attempts to convert the string to a signed integer. Returns TRUE on suceess +(the number is stored in the location pointed to by {\it val}) or FALSE if the +string does not represent such number. + +\membersection{wxString::ToULong}\label{wxstringtoulong} + +\constfunc{bool}{To}{\param{unsigned long}{ *val}} + +Attempts to convert the string to an unsigned integer. Returns TRUE on suceess +(the number is stored in the location pointed to by {\it val}) or FALSE if the +string does not represent such number. + \membersection{wxString::Trim}\label{wxstringtrim} \func{wxString\&}{Trim}{\param{bool}{ fromRight = TRUE}}