strusBase  0.17
Classes | Namespaces | Enumerations | Functions
numstring.hpp File Reference
#include "strus/base/stdint.h"
#include <string>
#include <stdexcept>

Go to the source code of this file.

Classes

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

Namespaces

 strus
 Wrapper to structures needed for atomic counters.
 

Enumerations

enum  strus::NumParseError {
  strus::NumParseOk = 0x0, strus::NumParseErrNoMem = 0x1, strus::NumParseErrConversion = 0x2, strus::NumParseErrOutOfRange = 0x3,
  strus::NumParseErrInvalidArg = 0x4
}
 

Functions

const char * strus::numstring_error (NumParseError errcode)
 Convert string conversion error code into an error message string. More...
 
std::runtime_error strus::numstring_exception (NumParseError errcode)
 Convert string conversion error code into an exception. More...
 
double strus::doubleFromString (const std::string &numstr, NumParseError &err)
 Parsing a double precision floating point number from an Ascii string. More...
 
double strus::doubleFromString (const char *numstr, std::size_t numsize, NumParseError &err)
 Parsing a double precision floating point number from an Ascii string. More...
 
int64_t strus::intFromString (const std::string &numstr, int64_t maxvalue, NumParseError &err)
 Parsing an integer number from an Ascii string. More...
 
int64_t strus::intFromString (const char *numstr, std::size_t numsize, int64_t maxvalue, NumParseError &err)
 Parsing an integer number from an Ascii string. More...
 
uint64_t strus::uintFromString (const std::string &numstr, uint64_t maxvalue, NumParseError &err)
 Parsing an unsigned integer number from an Ascii string. More...
 
uint64_t strus::uintFromString (const char *numstr, std::size_t numsize, uint64_t maxvalue, NumParseError &err)
 Parsing an unsigned integer number from an Ascii string. More...