VirtualBox

Changeset 83837 in vbox for trunk/include/iprt/utf16.h


Ignore:
Timestamp:
Apr 20, 2020 12:34:06 AM (5 years ago)
Author:
vboxsync
Message:

IPRT: Added RTUtf16Printf, RTUtf16PrintfV, RTUtf16PrintfEx and RTUtf16PrintfExV. bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/utf16.h

    r82968 r83837  
    13821382RTDECL(int) RTUtf16PrintHexBytes(PRTUTF16 pwszBuf, size_t cwcBuf, void const *pv, size_t cb, uint32_t fFlags);
    13831383
     1384/**
     1385 * String printf producing UTF-16 output.
     1386 *
     1387 * @returns On success, positive count of formatted RTUTF16 units excluding the
     1388 *          terminator.  On buffer overflow, negative number giving the required
     1389 *          buffer size (including terminator) in RTUTF16 units.
     1390 *
     1391 * @param   pwszBuffer  Output buffer.
     1392 * @param   cwcBuffer   Size of the output buffer in RTUTF16 units.
     1393 * @param   pszFormat   Pointer to the format string, @see pg_rt_str_format.
     1394 * @param   args        The format argument.
     1395 *
     1396 * @note    This is similar to RTStrPrintf2V (not RTStrPrintfV)!
     1397 */
     1398RTDECL(ssize_t) RTUtf16PrintfV(PRTUTF16 pwszBuffer, size_t cwcBuffer, const char *pszFormat, va_list args) RT_IPRT_FORMAT_ATTR(3, 0);
     1399
     1400/**
     1401 * String printf producing UTF-16 output.
     1402 *
     1403 * @returns On success, positive count of formatted RTUTF16 units excluding the
     1404 *          terminator.  On buffer overflow, negative number giving the required
     1405 *          buffer size (including terminator) in RTUTF16 units.
     1406 *
     1407 * @param   pwszBuffer  Output buffer.
     1408 * @param   cwcBuffer   Size of the output buffer in RTUTF16 units.
     1409 * @param   pszFormat   Pointer to the format string, @see pg_rt_str_format.
     1410 * @param   ...         The format argument.
     1411 *
     1412 * @note    This is similar to RTStrPrintf2 (not RTStrPrintf)!
     1413 */
     1414RTDECL(ssize_t) RTUtf16Printf(PRTUTF16 pwszBuffer, size_t cwcBuffer, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(3, 4);
     1415
     1416/**
     1417 * String printf producing UTF-16 output with custom formatting.
     1418 *
     1419 * @returns On success, positive count of formatted RTUTF16 units excluding the
     1420 *          terminator.  On buffer overflow, negative number giving the required
     1421 *          buffer size (including terminator) in RTUTF16 units.
     1422 *
     1423 * @param   pfnFormat   Pointer to handler function for the custom formats.
     1424 * @param   pvArg       Argument to the pfnFormat function.
     1425 * @param   pwszBuffer  Output buffer.
     1426 * @param   cwcBuffer   Size of the output buffer in RTUTF16 units.
     1427 * @param   pszFormat   Pointer to the format string, @see pg_rt_str_format.
     1428 * @param   args        The format argument.
     1429 *
     1430 * @note    This is similar to RTStrPrintf2ExV (not RTStrPrintfExV)!
     1431 */
     1432RTDECL(ssize_t) RTUtf16PrintfExV(PFNSTRFORMAT pfnFormat, void *pvArg, PRTUTF16 pwszBuffer, size_t cwcBuffer,
     1433                                 const char *pszFormat, va_list args)  RT_IPRT_FORMAT_ATTR(5, 0);
     1434
     1435/**
     1436 * String printf producing UTF-16 output with custom formatting.
     1437 *
     1438 * @returns On success, positive count of formatted RTUTF16 units excluding the
     1439 *          terminator.  On buffer overflow, negative number giving the required
     1440 *          buffer size (including terminator) in RTUTF16 units.
     1441 *
     1442 * @param   pfnFormat   Pointer to handler function for the custom formats.
     1443 * @param   pvArg       Argument to the pfnFormat function.
     1444 * @param   pwszBuffer  Output buffer.
     1445 * @param   cwcBuffer   Size of the output buffer in RTUTF16 units.
     1446 * @param   pszFormat   Pointer to the format string, @see pg_rt_str_format.
     1447 * @param   ...         The format argument.
     1448 *
     1449 * @note    This is similar to RTStrPrintf2Ex (not RTStrPrintfEx)!
     1450 */
     1451RTDECL(ssize_t) RTUtf16PrintfEx(PFNSTRFORMAT pfnFormat, void *pvArg, PRTUTF16 pwszBuffer, size_t cwcBuffer,
     1452                                const char *pszFormat, ...)  RT_IPRT_FORMAT_ATTR(5, 6);
     1453
    13841454/** @} */
    13851455RT_C_DECLS_END
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