strusBase  0.17
Static Public Member Functions | List of all members
strus::numstring_conv Struct Reference

Inlined version of string to number conversion functions throwing an exception instead of setting an error code on failure. More...

#include <numstring.hpp>

Static Public Member Functions

static int64_t toint (const std::string &str, int64_t maxval)
 Parsing an integer number from an Ascii string, throwing in case of error. More...
 
static int64_t toint (const char *str, std::size_t len, int64_t maxval)
 Parsing an integer number from an Ascii string, throwing in case of error. More...
 
static uint64_t touint (const std::string &str, uint64_t maxval)
 Parsing an unsigned integer number from an Ascii string, throwing in case of error. More...
 
static uint64_t touint (const char *str, std::size_t len, uint64_t maxval)
 Parsing an unsigned integer number from an Ascii string, throwing in case of error. More...
 
static double todouble (const std::string &str)
 Parsing a double precision floating point number from an Ascii string, throwing in case of error. More...
 
static double todouble (const char *str, std::size_t len)
 Parsing a double precision floating point number from an Ascii string, throwing in case of error. More...
 

Detailed Description

Inlined version of string to number conversion functions throwing an exception instead of setting an error code on failure.

Member Function Documentation

static double strus::numstring_conv::todouble ( const std::string &  str)
inlinestatic

Parsing a double precision floating point number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
Returns
the number parsed as an unsigned integer
static double strus::numstring_conv::todouble ( const char *  str,
std::size_t  len 
)
inlinestatic

Parsing a double precision floating point number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
[in]lenlength of str in bytes
Returns
the number parsed as an unsigned integer
static int64_t strus::numstring_conv::toint ( const std::string &  str,
int64_t  maxval 
)
inlinestatic

Parsing an integer number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
[in]maxvalthe maximum value accepted for the result
Returns
the number parsed as an integer
static int64_t strus::numstring_conv::toint ( const char *  str,
std::size_t  len,
int64_t  maxval 
)
inlinestatic

Parsing an integer number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
[in]lenlength of str in bytes
[in]maxvalthe maximum value accepted for the result
Returns
the number parsed as an integer
static uint64_t strus::numstring_conv::touint ( const std::string &  str,
uint64_t  maxval 
)
inlinestatic

Parsing an unsigned integer number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
[in]maxvalthe maximum value accepted for the result
Returns
the number parsed as an unsigned integer
static uint64_t strus::numstring_conv::touint ( const char *  str,
std::size_t  len,
uint64_t  maxval 
)
inlinestatic

Parsing an unsigned integer number from an Ascii string, throwing in case of error.

Parameters
[in]strthe number to parse as Ascii string
[in]lenlength of str in bytes
[in]maxvalthe maximum value accepted for the result
Returns
the number parsed as an unsigned integer

The documentation for this struct was generated from the following file: