VirtualBox

Ignore:
Timestamp:
Oct 17, 2021 5:48:02 PM (3 years ago)
Author:
vboxsync
Message:

IPRT/strprintf: Prep for splitting out the ellipsis functions. bugref:10124

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strprintf.cpp

    r82968 r91787  
    9999
    100100
    101 RTDECL(size_t) RTStrPrintf(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
     101RTDECL(size_t) RTStrPrintfV(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    102102{
    103     /* Explicitly inline RTStrPrintfV + RTStrPrintfExV here because this is a frequently use API. */
    104103    STRBUFARG Arg;
    105     va_list args;
    106     size_t cbRet;
    107 
    108104    AssertMsgReturn(cchBuffer, ("Excellent idea! Format a string with no space for the output!\n"), 0);
    109105    Arg.psz = pszBuffer;
    110106    Arg.cch = cchBuffer - 1;
     107    return RTStrFormatV(strbufoutput, &Arg, NULL, NULL, pszFormat, args);
     108}
     109RT_EXPORT_SYMBOL(RTStrPrintfV);
    111110
    112     va_start(args, pszFormat);
    113     cbRet = RTStrFormatV(strbufoutput, &Arg, NULL, NULL, pszFormat, args);
    114     va_end(args);
    115111
     112RTDECL(size_t) RTStrPrintf(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
     113{
     114    size_t  cbRet;
     115    va_list va;
     116    va_start(va, pszFormat);
     117    cbRet = RTStrPrintfV(pszBuffer, cchBuffer, pszFormat, va);
     118    va_end(va);
    116119    return cbRet;
    117120}
     
    130133
    131134
    132 RTDECL(size_t) RTStrPrintfV(char *pszBuffer, size_t cchBuffer, const char *pszFormat, va_list args)
    133 {
    134     return RTStrPrintfExV(NULL, NULL, pszBuffer, cchBuffer, pszFormat, args);
    135 }
    136 RT_EXPORT_SYMBOL(RTStrPrintfV);
    137 
    138135
    139136RTDECL(size_t) RTStrPrintfEx(PFNSTRFORMAT pfnFormat, void *pvArg, char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette