5#ifndef VALUE_PARSER_HPP_
6#define VALUE_PARSER_HPP_
24 if (std::isspace(
static_cast<unsigned char>(
input_[
pos_]))) {
49 if (std::isdigit(
static_cast<unsigned char>(c))) {
51 }
else if (c ==
'.' && !has_dot) {
54 }
else if ((c ==
'e' || c ==
'E') && !has_exp) {
68 value = std::stof(
input_.substr(start,
pos_ - start));
89 if (std::isdigit(
static_cast<unsigned char>(c))) {
91 }
else if (c ==
'.' && !has_dot) {
94 }
else if ((c ==
'e' || c ==
'E') && !has_exp) {
108 value = std::stod(
input_.substr(start,
pos_ - start));
126 && std::isdigit(
static_cast<unsigned char>(
input_[
pos_]))) {
132 long long_val = std::stol(
input_.substr(start,
pos_ - start));
133 value =
static_cast<short>(long_val);
151 && std::isdigit(
static_cast<unsigned char>(
input_[
pos_]))) {
157 value = std::stol(
input_.substr(start,
pos_ - start));
211 if (std::isalnum(
static_cast<unsigned char>(c)) || c ==
'@' || c ==
'#'
212 || c ==
':' || c ==
'+' || c ==
'-' || c ==
'%' || c ==
'.' || c ==
'_'
213 || c ==
'$' || c ==
'&' || c ==
'/') {
bool parseQuotedString(std::string &value)
size_t getPosition() const
bool parseLong(long &value)
const std::string & input_
bool parseString(std::string &value)
bool parseChar(char &value)
bool parseFloat(float &value)
void setPosition(size_t pos)
ValueParser(const std::string &input, size_t start_pos=0)
bool parseDouble(double &value)
bool parseShort(short &value)