VirtualBox

Changeset 79562 in vbox for trunk/include


Ignore:
Timestamp:
Jul 5, 2019 8:37:19 PM (6 years ago)
Author:
vboxsync
Message:

IPRT: Added RTSTRCONVERTHEXBYTES_F_SEP_COLON as well as a RTStrConvertHexBytesEx variant. bugref:9288

Location:
trunk/include/iprt
Files:
2 edited

Legend:

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

    r79559 r79562  
    20642064# define RTStrCmp                                       RT_MANGLER(RTStrCmp)
    20652065# define RTStrConvertHexBytes                           RT_MANGLER(RTStrConvertHexBytes)
     2066# define RTStrConvertHexBytesEx                         RT_MANGLER(RTStrConvertHexBytesEx)
    20662067# define RTStrCopy                                      RT_MANGLER(RTStrCopy)
    20672068# define RTStrCopyEx                                    RT_MANGLER(RTStrCopyEx)
  • trunk/include/iprt/string.h

    r79013 r79562  
    31433143 * @param   pv          Output buffer.
    31443144 * @param   cb          The size of the output buffer.
    3145  * @param   fFlags      Must be zero, reserved for future use.
     3145 * @param   fFlags      RTSTRCONVERTHEXBYTES_F_XXX.
    31463146 */
    31473147RTDECL(int) RTStrConvertHexBytes(char const *pszHex, void *pv, size_t cb, uint32_t fFlags);
     3148
     3149/** @name RTSTRCONVERTHEXBYTES_F_XXX - Flags for RTStrConvertHexBytes() and RTStrConvertHexBytesEx().
     3150 * @{  */
     3151/** Accept colon as a byte separator. */
     3152#define RTSTRCONVERTHEXBYTES_F_SEP_COLON  RT_BIT(0)
     3153/** @} */
     3154
     3155/**
     3156 * Converts a string of hex bytes back into binary data, extended version.
     3157 *
     3158 * @returns IPRT status code.
     3159 * @retval  VERR_INVALID_POINTER if any of the pointers are wrong.
     3160 * @retval  VERR_BUFFER_OVERFLOW if the string contains too many hex bytes.
     3161 * @retval  VERR_BUFFER_UNDERFLOW if there aren't enough hex bytes to fill up
     3162 *          the output buffer and *pcbReturned is NULL.
     3163 * @retval  VINF_BUFFER_UNDERFLOW if there aren't enough hex bytes to fill up
     3164 *          the output buffer and *pcbReturned is not NULL, *pcbReturned holds
     3165 *          the actual number of bytes.
     3166 * @retval  VERR_UNEVEN_INPUT if the input contains a half byte.
     3167 * @retval  VERR_NO_DIGITS
     3168 * @retval  VWRN_TRAILING_CHARS
     3169 * @retval  VWRN_TRAILING_SPACES
     3170 *
     3171 * @param   pszHex      The string containing the hex bytes.
     3172 * @param   pv          Output buffer.
     3173 * @param   cb          The size of the output buffer.
     3174 * @param   fFlags      RTSTRCONVERTHEXBYTES_F_XXX.
     3175 * @param   ppszNext    Set to point at where we stopped decoding hex bytes.
     3176 *                      Optional.
     3177 * @param   pcbReturned Where to return the number of bytes found.  Optional.
     3178 */
     3179RTDECL(int) RTStrConvertHexBytesEx(char const *pszHex, void *pv, size_t cb, uint32_t fFlags,
     3180                                   const char **ppszNext, size_t *pcbReturned);
    31483181
    31493182/** @} */
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