Changeset 21721 in vbox
- Timestamp:
- Jul 20, 2009 11:06:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r21714 r21721 1707 1707 1708 1708 /** 1709 * Translate a UTF-16 string into a Latin1 allocating the result buffer. 1709 * Translate a UTF-16 string into a Latin-1 (ISO-8859-1) allocating the result 1710 * buffer. 1710 1711 * 1711 1712 * @returns iprt status code. … … 1718 1719 1719 1720 /** 1720 * Translates UTF-16 to Latin 1 using buffer provided by the caller or1721 * a fittingly sized buffer allocated by the function.1721 * Translates UTF-16 to Latin-1 (ISO-8859-1) using buffer provided by the caller 1722 * or a fittingly sized buffer allocated by the function. 1722 1723 * 1723 1724 * @returns iprt status code. 1724 1725 * @param pwszString The UTF-16 string to convert. 1725 * @param cwcString The number of RTUTF16 items to translate from pwszString. 1726 * The translation will stop when reaching cwcString or the terminator ('\\0'). 1727 * Use RTSTR_MAX to translate the entire string. 1728 * @param ppsz If cch is non-zero, this must either be pointing to a pointer to 1729 * a buffer of the specified size, or pointer to a NULL pointer. 1730 * If *ppsz is NULL or cch is zero a buffer of at least cch chars 1731 * will be allocated to hold the translated string. 1732 * If a buffer was requested it must be freed using RTUtf16Free(). 1733 * @param cch The buffer size in chars (the type). This includes the terminator. 1734 * @param pcch Where to store the length of the translated string. (Optional) 1735 * This field will be updated even on failure, however the value is only 1736 * specified for the following two error codes. On VERR_BUFFER_OVERFLOW 1737 * and VERR_NO_STR_MEMORY it contains the required buffer space. 1726 * @param cwcString The number of RTUTF16 items to translate from 1727 * pwszString. The translation will stop when reaching 1728 * cwcString or the terminator ('\\0'). Use RTSTR_MAX 1729 * to translate the entire string. 1730 * @param ppsz If cch is non-zero, this must either be pointing to 1731 * a pointer to a buffer of the specified size, or 1732 * pointer to a NULL pointer. If *ppsz is NULL or cch 1733 * is zero a buffer of at least cch chars will be 1734 * allocated to hold the translated string. If a buffer 1735 * was requested it must be freed using RTUtf16Free(). 1736 * @param cch The buffer size in chars (the type). This includes 1737 * the terminator. 1738 * @param pcch Where to store the length of the translated string. 1739 * (Optional) 1740 * This will be set even on failure, however the value 1741 * is only specified for the following two error 1742 * codes. On VERR_BUFFER_OVERFLOW and 1743 * VERR_NO_STR_MEMORY it contains the required buffer 1744 * space. 1738 1745 */ 1739 1746 RTDECL(int) RTUtf16ToLatin1Ex(PCRTUTF16 pwszString, size_t cwcString, char **ppsz, size_t cch, size_t *pcch); 1740 1747 1741 1748 /** 1742 * Calculates the length of the UTF-16 string in Latin 1 chars (bytes).1749 * Calculates the length of the UTF-16 string in Latin-1 (ISO-8859-1) chars. 1743 1750 * 1744 1751 * This function will validate the string, and incorrectly encoded UTF-16 … … 1754 1761 1755 1762 /** 1756 * Calculates the length of the UTF-16 string in Latin 1 chars (bytes).1763 * Calculates the length of the UTF-16 string in Latin-1 (ISO-8859-1) chars. 1757 1764 * 1758 1765 * This function will validate the string, and incorrectly encoded UTF-16 … … 1761 1768 * @returns iprt status code. 1762 1769 * @param pwsz The string. 1763 * @param cwc The max string length. Use RTSTR_MAX to process the entire string. 1770 * @param cwc The max string length. Use RTSTR_MAX to process the 1771 * entire string. 1764 1772 * @param pcch Where to store the string length (in bytes). Optional. 1765 1773 * This is undefined on failure. … … 1780 1788 * @returns iprt status code. 1781 1789 * @param psz The string. 1782 * @param cch The max string length. Use RTSTR_MAX to process the entire string. 1790 * @param cch The max string length. Use RTSTR_MAX to process the 1791 * entire string. 1783 1792 * @param pcwc Where to store the string length. Optional. 1784 1793 * This is undefined on failure. … … 1787 1796 1788 1797 /** 1789 * Translate a Latin1 string into a UTF-16 allocating the result buffer. 1798 * Translate a Latin-1 (ISO-8859-1) string into a UTF-16 allocating the result 1799 * buffer. 1790 1800 * 1791 1801 * @returns iprt status code. 1792 1802 * @param pszString Latin1 string to convert. 1793 * @param ppwszString Receives pointer to the allocated UTF-16 string. 1794 * The returned string must be freed using 1795 * RTUtf16Free(). 1803 * @param ppwszString Receives pointer to the allocated UTF-16 string. The 1804 * returned string must be freed using RTUtf16Free(). 1796 1805 */ 1797 1806 RTDECL(int) RTLatin1ToUtf16(const char *pszString, PRTUTF16 *ppwszString); 1798 1807 1799 1808 /** 1800 * Translates pszString from Latin 1 to UTF-16, allocating the result buffer1801 * if requested.1809 * Translates pszString from Latin-1 (ISO-8859-1) to UTF-16, allocating the 1810 * result buffer if requested. 1802 1811 * 1803 1812 * @returns iprt status code. … … 1817 1826 * terminator. 1818 1827 * @param pcwc Where to store the length of the translated 1819 * string. (Optional) 1820 * This field will be updated even on failure, 1828 * string. (Optional) This will be set even on failure, 1821 1829 * however the value is only specified for the 1822 1830 * following two error codes. On VERR_BUFFER_OVERFLOW
Note:
See TracChangeset
for help on using the changeset viewer.