From commits-return-3077-apmail-stdcxx-commits-archive=stdcxx.apache.org@stdcxx.apache.org Wed Jun 11 17:32:12 2008 Return-Path: Delivered-To: apmail-stdcxx-commits-archive@www.apache.org Received: (qmail 52929 invoked from network); 11 Jun 2008 17:32:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2008 17:32:12 -0000 Received: (qmail 44219 invoked by uid 500); 11 Jun 2008 17:32:14 -0000 Delivered-To: apmail-stdcxx-commits-archive@stdcxx.apache.org Received: (qmail 44202 invoked by uid 500); 11 Jun 2008 17:32:14 -0000 Mailing-List: contact commits-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list commits@stdcxx.apache.org Received: (qmail 44193 invoked by uid 99); 11 Jun 2008 17:32:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 10:32:14 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2008 17:31:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 31CC823889FE; Wed, 11 Jun 2008 10:31:21 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r666742 - in /stdcxx/branches/4.2.x/tests/include: rw_driver.h rw_printf.h Date: Wed, 11 Jun 2008 17:31:21 -0000 To: commits@stdcxx.apache.org From: elemings@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080611173121.31CC823889FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elemings Date: Wed Jun 11 10:31:20 2008 New Revision: 666742 URL: http://svn.apache.org/viewvc?rev=666742&view=rev Log: 2008-06-11 Eric Lemings STDCXX-871 * tests/include/rw_driver.h (rw_fatal): * tests/include/rw_printf.h (rw_sprintfa, rw_snprintfa): Add link to page containing specifications for formatting directives. * tests/include/rw_printf.h (rw_asnprintf): Removed old list of formatting directives. Added more specifications for formatting directives to rwtest-fmtspec page and listed undocumented (i.e. complicated) formatting directives in a separate section so all directives are at least accounted for. Modified: stdcxx/branches/4.2.x/tests/include/rw_driver.h stdcxx/branches/4.2.x/tests/include/rw_printf.h Modified: stdcxx/branches/4.2.x/tests/include/rw_driver.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/include/rw_driver.h?rev=666742&r1=666741&r2=666742&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/include/rw_driver.h (original) +++ stdcxx/branches/4.2.x/tests/include/rw_driver.h Wed Jun 11 10:31:20 2008 @@ -98,7 +98,8 @@ * @param line When positive, denotes the line number of the location * relevant to the diagnostic. Negative values are ignored. * @param fmtspec A printf format specifier (with extensions) used - * to format the text of the diagnostic. + * to format the text of the diagnostic. See rwtest-fmtspec page + * for details. * @param ... Optional list of values to format. * * @return Returns the value of expr passed to it. Modified: stdcxx/branches/4.2.x/tests/include/rw_printf.h URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/include/rw_printf.h?rev=666742&r1=666741&r2=666742&view=diff ============================================================================== --- stdcxx/branches/4.2.x/tests/include/rw_printf.h (original) +++ stdcxx/branches/4.2.x/tests/include/rw_printf.h Wed Jun 11 10:31:20 2008 @@ -79,7 +79,7 @@ /** * Prints to a dynamically allocated character buffer. * - * @param fmt Format specifier. + * @param fmt Format specifier. See rwtest-fmtspec page for details. * * @return On success, returns a pointer to the dynamically allocated * character buffer. Otherwise, returns 0. @@ -94,6 +94,7 @@ * @param buf A pointer to character buffer where the function should * store its output. * @param bufise The size of the character buffer in bytes. + * @param fmt Format specifier. See rwtest-fmtspec page for details. * * @return On success, if the size of the supplied buffer was sufficient * to format all characters including the terminating NUL, returns @@ -124,34 +125,7 @@ * to by this argument to the size of the dynamically allocated * character buffer, or leaves it unchanged if it doesn't allocate * any buffer. - * @param fmt Format specifier. - * The format specifier string has the same syntax as C99 sprintf - * (see 7.19.6.1 of ISO/IEC 9899:1999) with the following extensions: - * - * %n$ where n is a integer (see IEEE Std 1003.1) - * %m the value of strerror(errno) - * - * %{?} if clause (extracts an int) - * %{:} else clause - * %{;} end of if/else clause - * - * %{Ac} quoted array of narrow characters - * %{*Ac} quoted array of characters of width '*' each - * where '*' is an int argument extracted from - * the argument list - * %{#s} quoted narrow character string - * %{#ls} quoted wide character string - * %{$envvar} value of an environment variable envvar - * %{f} function pointer - * %{K} signal name (such as "SIGABRT") - * %{M} member pointer - * %{#m} name of the errno constant (such as "EINVAL") - * %{n} buffer size - * %{S} pointer to std::string - * %{lS} pointer to std::wstring - * %{tm} pointer to struct tm - * %{InJ} where n is one of { 8, 16, 32, 64 } - * and J is one of { d, o, x, X } + * @param fmt Format specifier. See rwtest-fmtspec page for details. * * @return On success, returns the number of characters formatted into * the buffer, otherwise -1. @@ -173,6 +147,9 @@ * directives and conversions. Directives that accept a pointer argument * will convert a null pointer into the string literal (null). * + * Specifiers within formatting directives are denoted by angle brackets. + * The specifiers are placeholders whose range of possible values are + * listed in the description of the directive. * * @section rwtest-fmtspec-c89 C89 Directives * @@ -198,6 +175,16 @@ * of the argument is nonzero, the value is converted to the string * literal \c true. Otherwise, the value converts to \c false. * + * @subsection rwtest-fmtspec-ext-funptr Function Pointer \%{f} + * + * The argument is a pointer to a function. The conversion and formatting + * is performed as specified by the \c \%p directive. + * + * @subsection rwtest-fmtspec-ext-memptr Member Pointer \%{M} + * + * The argument is a pointer to a composite member. The conversion and + * formatting is performed as specified by the \c \%p directive. + * * @subsection rwtest-fmtspec-ext-esc-c Escaped Character \%{c} \%{\#c} * * The argument is an integer value converted to unsigned char @@ -245,19 +232,29 @@ * * @subsection rwtest-fmtspec-ext-bits Bitset \%{b} * - * The argument is a pointer to an array of \c char. NOT YET COMPLETE + * The argument is a pointer to an array of \c char. Each bit in the + * array, ordered from MSB of the first element to LSB of the last + * element is converted into a sequence of '0' or '1' characters. * - * @subsection rwtest-fmtspec-ext-Ai Integer Array \%{Ao} \%{Ad} \%{Ax} + * @subsection rwtest-fmtspec-ext-Ai Integer Array \%{Ac} \%{Ao} \%{Ad} \%{Ax} * * The argument is a pointer to an array of integer type. The resulting * output is formatted as a string of comma-separated integer values. - * The notation of each integer value is specified by o for - * octal, d for decimal, or x for hexadcimal. An - * optional field width specifies the size of elements in the array - * (defaults to 1). An optional precision specifies the length of the - * array. In the alternate form, the resulting output for octal and - * hexidecimal integer values are prefixed with string literals - * 0 and 0x respectively. + * The notation of each integer value is specified by c for + * characters, <o for octal, d for decimal, or + * x for hexadcimal. An optional field width specifies the + * size of elements in the array (defaults to 1). An optional precision + * specifies the length of the array. In the alternate form, the + * resulting output for octal and hexidecimal integer values are + * prefixed with string literals 0 and 0x respectively. + * + * @subsection rwtest-fmtspec-ext-I Fixed-Width Integers \%{I} + * + * The argument is a value of an integer type. The directive requires + * two specifiers: the w specifier is one of 8, 16, 32, or 64 + * specifying the width of the integer value. The n specifier + * is one of \c d, \c o, \c x, or \c X specifying the notation of the + * resulting output. * * @subsection rwtest-fmtspec-ext-Is Stream State \%{Is} \%{\#Is} * @@ -321,10 +318,15 @@ * @subsection rwtest-fmtspec-ext-str String \%{S} * * The argument is a pointer to an object of the \c std::string class. - * If the pointer is null, the resulting output is the string literal - * (null). Otherwise, the pointer \c P is converted by calling - * the \c P->c_str() function and the result is formatted identical to - * the %s character string directive. + * Otherwise, the pointer \c P is converted by calling the \c P->c_str() + * function and the result is formatted identical to the %s + * character string directive. + * + * @subsection rwtest-fmtspec-ext-wstr Wide String \%{lS} + * + * The argument is a pointer to an object of the \c std::wstring class. + * Conversion and formatting is performed as stated for the \c \%{S} + * directive. * * @subsection rwtest-fmtspec-ext-tm Time Structure \%{t} \%{\#t} * @@ -340,6 +342,19 @@ * "[range]" is only shown if the value is not in the valid range for * the respective member. * + * @subsection rwtest-fmtspec-ext-other Other Directives + * + * The following directives are also recognized by RWTest output + * functions but are heretofore undocumented. + * + *
    + *
  • \%{} buffer size + *
  • \%{$} positional parameter + *
  • \%{$} environment variable + *
  • \%{?} \%{:} \%{;} conditionals + *
  • \%{@} nested format + *
  • \%{!} user-defined format + *
*/ #endif // RW_PRINTF_H_INCLUDED