VirtualBox

Changeset 96127 in vbox for trunk/include


Ignore:
Timestamp:
Aug 9, 2022 10:00:57 AM (2 years ago)
Author:
vboxsync
Message:

IPRT/RTStrTo[U]Int[8|16|32|64][Ex|Full]: Tweaked the base parameter to allow passing a maximum length. Need this for the no-CRT sscanf code. bugref:10261

File:
1 edited

Legend:

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

    r94421 r96127  
    28402840 * @retval  VERR_NO_DIGITS
    28412841 *
    2842  * @param   pszValue    Pointer to the string value.
    2843  * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
    2844  * @param   uBase       The base of the representation used.
    2845  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2846  * @param   pu64        Where to store the converted number. (optional)
    2847  */
    2848 RTDECL(int) RTStrToUInt64Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint64_t *pu64);
     2842 * @param   pszValue        Pointer to the string value.
     2843 * @param   ppszNext        Where to store the pointer to the first char
     2844 *                          following the number. (Optional)
     2845 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     2846 *                          upper 24 bits are the max length to parse.  If the base
     2847 *                          is zero the function will look for known prefixes before
     2848 *                          defaulting to 10.  A max length of zero means no length
     2849 *                          restriction.
     2850 * @param   pu64            Where to store the converted number. (optional)
     2851 */
     2852RTDECL(int) RTStrToUInt64Ex(const char *pszValue, char **ppszNext, unsigned uBaseAndLen, uint64_t *pu64);
    28492853
    28502854/**
     
    28612865 * @retval  VERR_TRAILING_CHARS
    28622866 *
    2863  * @param   pszValue    Pointer to the string value.
    2864  * @param   uBase       The base of the representation used.
    2865  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2866  * @param   pu64        Where to store the converted number. (optional)
     2867 * @param   pszValue        Pointer to the string value.
     2868 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     2869 *                          upper 24 bits are the max length to parse.  If the base
     2870 *                          is zero the function will look for known prefixes before
     2871 *                          defaulting to 10.  A max length of zero means no length
     2872 *                          restriction.
     2873 * @param   pu64            Where to store the converted number. (optional)
    28672874 */
    28682875RTDECL(int) RTStrToUInt64Full(const char *pszValue, unsigned uBase, uint64_t *pu64);
     
    28902897 * @retval  VERR_NO_DIGITS
    28912898 *
    2892  * @param   pszValue    Pointer to the string value.
    2893  * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
    2894  * @param   uBase       The base of the representation used.
    2895  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2896  * @param   pu32        Where to store the converted number. (optional)
     2899 * @param   pszValue        Pointer to the string value.
     2900 * @param   ppszNext        Where to store the pointer to the first char
     2901 *                          following the number. (Optional)
     2902 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     2903 *                          upper 24 bits are the max length to parse.  If the base
     2904 *                          is zero the function will look for known prefixes before
     2905 *                          defaulting to 10.  A max length of zero means no length
     2906 *                          restriction.
     2907 * @param   pu32            Where to store the converted number. (optional)
    28972908 */
    28982909RTDECL(int) RTStrToUInt32Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint32_t *pu32);
     
    29112922 * @retval  VERR_TRAILING_CHARS
    29122923 *
    2913  * @param   pszValue    Pointer to the string value.
    2914  * @param   uBase       The base of the representation used.
    2915  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2916  * @param   pu32        Where to store the converted number. (optional)
     2924 * @param   pszValue        Pointer to the string value.
     2925 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     2926 *                          upper 24 bits are the max length to parse.  If the base
     2927 *                          is zero the function will look for known prefixes before
     2928 *                          defaulting to 10.  A max length of zero means no length
     2929 *                          restriction.
     2930 * @param   pu32            Where to store the converted number. (optional)
    29172931 */
    29182932RTDECL(int) RTStrToUInt32Full(const char *pszValue, unsigned uBase, uint32_t *pu32);
     
    29402954 * @retval  VERR_NO_DIGITS
    29412955 *
    2942  * @param   pszValue    Pointer to the string value.
    2943  * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
    2944  * @param   uBase       The base of the representation used.
    2945  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2946  * @param   pu16        Where to store the converted number. (optional)
     2956 * @param   pszValue        Pointer to the string value.
     2957 * @param   ppszNext        Where to store the pointer to the first char
     2958 *                          following the number. (Optional)
     2959 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     2960 *                          upper 24 bits are the max length to parse.  If the base
     2961 *                          is zero the function will look for known prefixes before
     2962 *                          defaulting to 10.  A max length of zero means no length
     2963 *                          restriction.
     2964 * @param   pu16            Where to store the converted number. (optional)
    29472965 */
    29482966RTDECL(int) RTStrToUInt16Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint16_t *pu16);
     
    29903008 * @retval  VERR_NO_DIGITS
    29913009 *
    2992  * @param   pszValue    Pointer to the string value.
    2993  * @param   ppszNext    Where to store the pointer to the first char following the number. (Optional)
    2994  * @param   uBase       The base of the representation used.
    2995  *                      If 0 the function will look for known prefixes before defaulting to 10.
    2996  * @param   pu8         Where to store the converted number. (optional)
     3010 * @param   pszValue        Pointer to the string value.
     3011 * @param   ppszNext        Where to store the pointer to the first char
     3012 *                          following the number. (Optional)
     3013 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     3014 *                          upper 24 bits are the max length to parse.  If the base
     3015 *                          is zero the function will look for known prefixes before
     3016 *                          defaulting to 10.  A max length of zero means no length
     3017 *                          restriction.
     3018 * @param   pu8             Where to store the converted number. (optional)
    29973019 */
    29983020RTDECL(int) RTStrToUInt8Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint8_t *pu8);
     
    30113033 * @retval  VERR_TRAILING_CHARS
    30123034 *
    3013  * @param   pszValue    Pointer to the string value.
    3014  * @param   uBase       The base of the representation used.
    3015  *                      If 0 the function will look for known prefixes before defaulting to 10.
    3016  * @param   pu8         Where to store the converted number. (optional)
     3035 * @param   pszValue        Pointer to the string value.
     3036 * @param   uBaseAndMaxLen  The low byte is the base of the representation, the
     3037 *                          upper 24 bits are the max length to parse.  If the base
     3038 *                          is zero the function will look for known prefixes before
     3039 *                          defaulting to 10.  A max length of zero means no length
     3040 *                          restriction.
     3041 * @param   pu8             Where to store the converted number. (optional)
    30173042 */
    30183043RTDECL(int) RTStrToUInt8Full(const char *pszValue, unsigned uBase, uint8_t *pu8);
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