]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/function.tex
wxXmlNode::GetAttribute's pointer argument must not be NULL, check for it
[wxWidgets.git] / docs / latex / wx / function.tex
index eb7efe5e94067bf6f35cd38e026596463cd2721f..62e622480a7a966064856df4b84fdc0b668acc9e 100644 (file)
@@ -37,6 +37,8 @@ the corresponding topic.
 \helpref{wxASSERT\_MSG}{wxassertmsg}\\
 \helpref{wxAtomicDec}{wxatomicdec}\\
 \helpref{wxAtomicInc}{wxatomicinc}\\
 \helpref{wxASSERT\_MSG}{wxassertmsg}\\
 \helpref{wxAtomicDec}{wxatomicdec}\\
 \helpref{wxAtomicInc}{wxatomicinc}\\
+\helpref{wxBase64Decode}{wxbase64decode}\\
+\helpref{wxBase64Encode}{wxbase64encode}\\
 \helpref{wxBeginBusyCursor}{wxbeginbusycursor}\\
 \helpref{wxBell}{wxbell}\\
 \helpref{wxBITMAP}{wxbitmapmacro}\\
 \helpref{wxBeginBusyCursor}{wxbeginbusycursor}\\
 \helpref{wxBell}{wxbell}\\
 \helpref{wxBITMAP}{wxbitmapmacro}\\
@@ -74,6 +76,7 @@ the corresponding topic.
 \helpref{WXDEBUG\_NEW}{debugnew}\\
 \helpref{wxDEPRECATED}{wxdeprecated}\\
 \helpref{wxDEPRECATED\_BUT\_USED\_INTERNALLY}{wxdeprecatedbutusedinternally}\\
 \helpref{WXDEBUG\_NEW}{debugnew}\\
 \helpref{wxDEPRECATED}{wxdeprecated}\\
 \helpref{wxDEPRECATED\_BUT\_USED\_INTERNALLY}{wxdeprecatedbutusedinternally}\\
+\helpref{wxDEPRECATED\_INLINE}{wxdeprecatedinline}\\
 \helpref{wxDirExists}{functionwxdirexists}\\
 \helpref{wxDirSelector}{wxdirselector}\\
 \helpref{wxDisplayDepth}{wxdisplaydepth}\\
 \helpref{wxDirExists}{functionwxdirexists}\\
 \helpref{wxDirSelector}{wxdirselector}\\
 \helpref{wxDisplayDepth}{wxdisplaydepth}\\
@@ -1799,11 +1802,9 @@ build. In fact, its definition is:
 \func{const wxChar *}{wxTRANSLATE}{\param{const char *}{s}}
 
 This macro doesn't do anything in the program code -- it simply expands to the
 \func{const wxChar *}{wxTRANSLATE}{\param{const char *}{s}}
 
 This macro doesn't do anything in the program code -- it simply expands to the
-value of its argument (except in Unicode build where it is equivalent to
-\helpref{wxT}{wxt} which makes it unnecessary to use both wxTRANSLATE and wxT
-with the same string which would be really unreadable).
+value of its argument.
 
 
-However it does have a purpose and it is to mark the literal strings for the
+However it does have a purpose which is to mark the literal strings for the
 extraction into the message catalog created by {\tt xgettext} program. Usually
 this is achieved using \helpref{\_()}{underscore} but that macro not only marks
 the string for extraction but also expands into a
 extraction into the message catalog created by {\tt xgettext} program. Usually
 this is achieved using \helpref{\_()}{underscore} but that macro not only marks
 the string for extraction but also expands into a
@@ -1818,7 +1819,7 @@ translated (note that it is a bad example, really, as
 day names already). If you write
 
 \begin{verbatim}
 day names already). If you write
 
 \begin{verbatim}
-static const wxChar * const weekdays[] = { _("Mon"), ..., _("Sun") };
+static const char * const weekdays[] = { _("Mon"), ..., _("Sun") };
 ...
 // use weekdays[n] as usual
 \end{verbatim}
 ...
 // use weekdays[n] as usual
 \end{verbatim}
@@ -1827,7 +1828,7 @@ the code wouldn't compile because the function calls are forbidden in the array
 initializer. So instead you should do
 
 \begin{verbatim}
 initializer. So instead you should do
 
 \begin{verbatim}
-static const wxChar * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
+static const char * const weekdays[] = { wxTRANSLATE("Mon"), ..., wxTRANSLATE("Sun") };
 ...
 // use wxGetTranslation(weekdays[n])
 \end{verbatim}
 ...
 // use wxGetTranslation(weekdays[n])
 \end{verbatim}
@@ -1839,6 +1840,7 @@ wxTRANSLATE() in the above, it wouldn't work as expected because there would be
 no translations for the weekday names in the program message catalog and
 wxGetTranslation wouldn't find them.
 
 no translations for the weekday names in the program message catalog and
 wxGetTranslation wouldn't find them.
 
+
 \membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
 \membersection{::wxVsnprintf}\label{wxvsnprintf}
 
 \func{int}{wxVsnprintf}{\param{wxChar *}{buf}, \param{size\_t }{len}, \param{const wxChar *}{format}, \param{va\_list }{argPtr}}
@@ -2435,7 +2437,7 @@ checkbox which is shown in the tips dialog.}
 
 \func{int}{wxFinite}{\param{double }{x}}
 
 
 \func{int}{wxFinite}{\param{double }{x}}
 
-Returns a non-zero value if {\it x} is neither infinite or NaN (not a number),
+Returns a non-zero value if {\it x} is neither infinite nor NaN (not a number),
 returns 0 otherwise.
 
 
 returns 0 otherwise.
 
 
@@ -2839,6 +2841,111 @@ The clipboard must have previously been opened for this call to succeed.
 \section{Miscellaneous functions}\label{miscellany}
 
 
 \section{Miscellaneous functions}\label{miscellany}
 
 
+\membersection{wxBase64Decode}\label{wxbase64decode}
+
+\func{size\_t}{wxBase64Decode}{\param{void *}{dst}, \param{size\_t }{dstLen}, 
+\param{const char * }{src}, \param{size\_t }{srcLen = wxNO\_LEN}, 
+\param{wxBase64DecodeMode }{mode = wxBase64DecodeMode\_Strict}, 
+\param{size\_t }{*posErr = \NULL}}
+
+\func{wxMemoryBuffer}{wxBase64Decode}{\\
+\param{const char * }{src}, \param{size\_t }{srcLen = wxNO\_LEN},\\
+\param{wxBase64DecodeMode }{mode = wxBase64DecodeMode\_Strict},\\
+\param{size\_t }{*posErr = \NULL}}
+
+These function decode a Base64-encoded string. The first version is a raw
+decoding function and decodes the data into the provided buffer \arg{dst} of
+the given size \arg{dstLen}. An error is returned if the buffer is not large
+enough -- that is not at least \helpref{wxBase64DecodedSize(srcLen)}{wxbase64decodedsize} 
+bytes. The second version allocates memory internally and returns it as
+\helpref{wxMemoryBuffer}{wxmemorybuffer} and is recommended for normal use.
+
+The first version returns the number of bytes written to the buffer or the
+necessary buffer size if \arg{dst} was \NULL or \texttt{wxCONV\_FAILED} on
+error, e.g. if the output buffer is too small or invalid characters were
+encountered in the input string. The second version returns a buffer with the
+base64 decoded binary equivalent of the input string. In neither case is the
+buffer NUL-terminated.
+
+\wxheading{Parameters}
+
+\docparam{dst}{Pointer to output buffer, may be \NULL to just compute the
+necessary buffer size.}
+
+\docparam{dstLen}{The size of the output buffer, ignored if \arg{dst} is
+\NULL.}
+
+\docparam{src}{The input string, must not be \NULL.}
+
+\docparam{srcLen}{The length of the input string or special value
+\texttt{wxNO\_LEN} if the string is \NUL-terminated and the length should be
+computed by this function itself.}
+
+\docparam{mode}{This parameter specifies the function behaviour when invalid
+characters are encountered in input. By default, any such character stops the
+decoding with error. If the mode is wxBase64DecodeMode\_SkipWS, then the white
+space characters are silently skipped instead. And if it is
+wxBase64DecodeMode\_Relaxed, then all invalid characters are skipped.}
+
+\docparam{posErr}{If this pointer is non-\NULL and an error occurs during
+decoding, it is filled with the index of the invalid character.}
+
+\wxheading{Include files}
+
+<wx/base64.h>
+
+
+\membersection{wxBase64DecodedSize}\label{wxbase64decodedsize}
+
+\func{size\_t}{wxBase64DecodedSize}{\param{size\_t }{srcLen}}
+
+Returns the size of the buffer necessary to contain the data encoded in a
+base64 string of length \arg{srcLen}. This can be useful for allocating a
+buffer to be passed to \helpref{wxBase64Decode}{wxbase64decode}.
+
+
+\membersection{wxBase64Encode}\label{wxbase64encode}
+
+\func{size\_t}{wxBase64Encode}{\param{char *}{dst}, \param{size\_t }{dstLen}, 
+\param{const void *}{src}, \param{size\_t }{srcLen}}
+
+\func{wxString}{wxBase64Encode}{\param{const void *}{src}, \param{size\_t }{srcLen}}
+
+\func{wxString}{wxBase64Encode}{\param{const wxMemoryBuffer\& }{buf}}
+
+These functions encode the given data using base64. The first of them is the
+raw encoding function writing the output string into provided buffer while the
+other ones return the output as wxString. There is no error return for these
+functions except for the first one which returns \texttt{wxCONV\_FAILED} if the
+output buffer is too small. To allocate the buffer of the correct size, use 
+\helpref{wxBase64EncodedSize}{wxbase64encodedsize} or call this function with 
+\arg{dst} set to \NULL -- it will then return the necessary buffer size.
+
+\wxheading{Parameters}
+
+\docparam{dst}{The output buffer, may be \NULL to retrieve the needed buffer
+size.}
+
+\docparam{dstLen}{The output buffer size, ignored if \arg{dst} is \NULL.}
+
+\docparam{src}{The input buffer, must not be \NULL.}
+
+\docparam{srcLen}{The length of the input data.}
+
+\wxheading{Include files}
+
+<wx/base64.h>
+
+
+\membersection{wxBase64EncodedSize}\label{wxbase64encodedsize}
+
+\func{size\_t}{wxBase64EncodedSize}{\param{size\_t }{len}}
+
+Returns the length of the string with base64 representation of a buffer of
+specified size \arg{len}. This can be useful for allocating the buffer passed
+to \helpref{wxBase64Encode}{wxbase64encode}.
+
+
 \membersection{wxCONCAT}\label{wxconcat}
 
 \func{}{wxCONCAT}{\param{}{x}, \param{}{y}}
 \membersection{wxCONCAT}\label{wxconcat}
 
 \func{}{wxCONCAT}{\param{}{x}, \param{}{y}}
@@ -2902,6 +3009,25 @@ used from the user code or, in case of Visual C++, even when it is simply
 overridden.
 
 
 overridden.
 
 
+\membersection{wxDEPRECATED\_INLINE}\label{wxdeprecatedinline}
+
+\func{}{wxDEPRECATED\_INLINE}{\param{}{func}, \param{}{body}}
+
+This macro is similar to \helpref{wxDEPRECATED}{wxdeprecated} but can be used
+to not only declare the function \arg{func} as deprecated but to also provide
+its (inline) implementation \arg{body}.
+
+It can be used as following:
+\begin{verbatim}
+    class wxFoo
+    {
+    public:
+        // OldMethod() is deprecated, use NewMethod() instead
+        void NewMethod();
+        wxDEPRECATED_INLINE( void OldMethod(), NewMethod() );
+    };
+\end{verbatim}
+
 \membersection{wxEXPLICIT}\label{wxexplicit}
 
 {\tt wxEXPLICIT} is a macro which expands to the C++ {\tt explicit} keyword if
 \membersection{wxEXPLICIT}\label{wxexplicit}
 
 {\tt wxEXPLICIT} is a macro which expands to the C++ {\tt explicit} keyword if
@@ -2993,7 +3119,9 @@ Generates an integer identifier unique to this run of the program.
 \membersection{wxON\_BLOCK\_EXIT}\label{wxonblockexit}
 
 \func{}{wxON\_BLOCK\_EXIT0}{\param{}{func}}
 \membersection{wxON\_BLOCK\_EXIT}\label{wxonblockexit}
 
 \func{}{wxON\_BLOCK\_EXIT0}{\param{}{func}}
+
 \func{}{wxON\_BLOCK\_EXIT1}{\param{}{func}, \param{}{p1}}
 \func{}{wxON\_BLOCK\_EXIT1}{\param{}{func}, \param{}{p1}}
+
 \func{}{wxON\_BLOCK\_EXIT2}{\param{}{func}, \param{}{p1}, \param{}{p2}}
 
 This family of macros allows to ensure that the global function \arg{func}
 \func{}{wxON\_BLOCK\_EXIT2}{\param{}{func}, \param{}{p1}, \param{}{p2}}
 
 This family of macros allows to ensure that the global function \arg{func}
@@ -3021,7 +3149,9 @@ details.
 \membersection{wxON\_BLOCK\_EXIT\_OBJ}\label{wxonblockexitobj}
 
 \func{}{wxON\_BLOCK\_EXIT\_OBJ0}{\param{}{obj}, \param{}{method}}
 \membersection{wxON\_BLOCK\_EXIT\_OBJ}\label{wxonblockexitobj}
 
 \func{}{wxON\_BLOCK\_EXIT\_OBJ0}{\param{}{obj}, \param{}{method}}
+
 \func{}{wxON\_BLOCK\_EXIT\_OBJ1}{\param{}{obj}, \param{}{method}, \param{}{p1}}
 \func{}{wxON\_BLOCK\_EXIT\_OBJ1}{\param{}{obj}, \param{}{method}, \param{}{p1}}
+
 \func{}{wxON\_BLOCK\_EXIT\_OBJ2}{\param{}{obj}, \param{}{method}, \param{}{p1}, \param{}{p2}}
 
 This family of macros is similar to \helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}
 \func{}{wxON\_BLOCK\_EXIT\_OBJ2}{\param{}{obj}, \param{}{method}, \param{}{p1}, \param{}{p2}}
 
 This family of macros is similar to \helpref{wxON\_BLOCK\_EXIT}{wxonblockexit}
@@ -3150,6 +3280,18 @@ Find the deepest window at the mouse pointer position, returning the window
 and current pointer position in screen coordinates.
 
 
 and current pointer position in screen coordinates.
 
 
+\membersection{wxFromString}\label{wxfromstring}
+
+\func{bool}{wxFromString}{\param{const wxString\& }{str},
+                           \param{wxColour* }{col}}
+
+\func{bool}{wxFromString}{\param{const wxString\& }{str},
+                           \param{wxFont* }{col}}
+
+Converts string to the type of the second argument. Returns \true on success.
+See also: \helpref{wxToString}{wxtostring}.
+
+
 \membersection{::wxGetActiveWindow}\label{wxgetactivewindow}
 
 \func{wxWindow *}{wxGetActiveWindow}{\void}
 \membersection{::wxGetActiveWindow}\label{wxgetactivewindow}
 
 \func{wxWindow *}{wxGetActiveWindow}{\void}
@@ -3465,6 +3607,16 @@ class name internally. Example of using the macro:
 Notice that there should be no semicolon after this macro.
 
 
 Notice that there should be no semicolon after this macro.
 
 
+\membersection{wxToString}\label{wxtostring}
+
+\func{wxString}{wxToString}{\param{const wxColour\& }{col}}
+
+\func{wxString}{wxToString}{\param{const wxFont\& }{col}}
+
+Converts its argument to string.
+See also: \helpref{wxFromString}{wxfromstring}.
+
+
 \membersection{wxULL}\label{wxull}
 
 \func{wxLongLong\_t}{wxULL}{\param{}{number}}
 \membersection{wxULL}\label{wxull}
 
 \func{wxLongLong\_t}{wxULL}{\param{}{number}}