From e7e0babfe67afe575618c5315605f7c197c5a814 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 6 Apr 2000 14:24:19 +0000 Subject: [PATCH] explained how to use wxString ctor with binary data git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/wxstring.tex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/latex/wx/wxstring.tex b/docs/latex/wx/wxstring.tex index 9c82d7fb3e..305a32ef43 100644 --- a/docs/latex/wx/wxstring.tex +++ b/docs/latex/wx/wxstring.tex @@ -395,7 +395,14 @@ Constructs a string of {\it n} copies of character {\it ch}. \func{}{wxString}{\param{const char*}{ psz}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}} Takes first {\it nLength} characters from the C string {\it psz}. -The default value of wxSTRING\_MAXLEN means take all the string. +The default value of wxSTRING\_MAXLEN means to take all the string. + +Note that this constructor may be used even if {\it psz} points to a buffer +with binary data (i.e. containing {\tt NUL} characters) as long as you provide +the correct value for {\it nLength}. However, the default form of it works +only with strings without intermediate {\tt NUL}s because it uses +{\tt strlen()} to calculate the effective length and it would not give correct +results otherwise. \func{}{wxString}{\param{const unsigned char*}{ psz}, \param{size\_t}{ nLength = wxSTRING\_MAXLEN}}