BloombergLP::bdlb::NumericParseUtil::parseSignedInteger

parseSignedInteger overloads

Synopses

Declared in <bdlb_numericparseutil.h>

Parse a signed integer within [minValue .. maxValue] from a string.

static
int
parseSignedInteger(
    bsls::Types::Int64* result,
    std::string_view const& inputString,
    int base,
    bsls::Types::Int64 const minValue,
    bsls::Types::Int64 const maxValue);
» more...

Parse a bounded signed integer from a string, also returning the suffix.

static
int
parseSignedInteger(
    bsls::Types::Int64* result,
    std::string_view* remainder,
    std::string_view const& inputString,
    int base,
    bsls::Types::Int64 const minValue,
    bsls::Types::Int64 const maxValue);
» more...

Return Value

0 on success, and a non-zero value otherwise

Parameters

NameDescription
resultlocation to store the parsed value
inputStringtext to parse
basenumeric base in [2 .. 36]
minValuelowest acceptable parsed value (must be negative)
maxValuehighest acceptable parsed value (must be positive)
remainderunparsed suffix of inputString after a successful parse (unchanged on failure)