]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/BaseLib: Add safe string functions that convert str to value
authorHao Wu <hao.a.wu@intel.com>
Mon, 12 Dec 2016 00:58:51 +0000 (08:58 +0800)
committerHao Wu <hao.a.wu@intel.com>
Mon, 9 Jan 2017 05:59:12 +0000 (13:59 +0800)
commitd8af3301a648df3b4eea6933a46f56f1853367d6
tree6c2c1fd8e4fd72ec8e13cae4d4ef3ae17f8632b6
parentb590e43ab62775f2127e70ed28c33462599cd508
MdePkg/BaseLib: Add safe string functions that convert str to value

Add the following 8 APIs:
[Ascii]StrDecimalToUintnS
[Ascii]StrDecimalToUint64S
[Ascii]StrHexToUintnS
[Ascii]StrHexToUint64S

These safe version APIs are used to enhance their counterpart (APIs
without trailing 'S' in function names).

These safe version APIs perform checks to the input string and will return
relative status to reflect the check result:
When the input string exceeds the range of UINTN/64, these APIs will
return RETURN_UNSUPPORTED and store MAX_UINTN/64 in the output data.
When no conversion can be performed for the input string, these APIs will
return RETURN_SUCCESS and store 0 in the output data.

The optional parameter 'EndPointer', if provided, will point to the
character that stopped the scan.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdePkg/Include/Library/BaseLib.h
MdePkg/Library/BaseLib/BaseLibInternals.h
MdePkg/Library/BaseLib/SafeString.c