From: Vadim Zeitlin Date: Wed, 12 May 2010 08:18:17 +0000 (+0000) Subject: Restore wxString::Printf() example showing position parameters in the docs. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8329f1d1d6c4b2c8d6cf061308b3096cc71f894b Restore wxString::Printf() example showing position parameters in the docs. The example was lost during the translation of the manual to Doxygen. Closes #12038. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/string.h b/interface/wx/string.h index dc82130d2a..90ee7d718f 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -1088,6 +1088,16 @@ public: Note that if @c wxUSE_PRINTF_POS_PARAMS is set to 1, then this function supports Unix98-style positional parameters: + @code + wxString str; + + str.Printf(wxT("%d %d %d"), 1, 2, 3); + // str now contains "1 2 3" + + str.Printf(wxT("%2$d %3$d %1$d"), 1, 2, 3); + // str now contains "2 3 1" + @endcode + @note 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