SpinParser  1.0
Functions
InputParser.hpp File Reference

Parse input strings to numerical values. Can resolve simple multiplications and sqrt() expressions. More...

#include <iostream>
#include <sstream>
#include "boost/regex.hpp"
#include "lib/Log.hpp"
Include dependency graph for InputParser.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double InputParser::stringToDouble (const std::string &input)
 Parse input string to double. Resolves simple multiplications, divisions and sqrt() expressions. Input may involve terms of the form x*x, x/x, sqrt(x), and longer compositions thereof, where x is a decimal number. More...
 
float InputParser::stringToFloat (const std::string &input)
 Parse input string to double. Resolves simple multiplications, divisions and sqrt() expressions. Input may involve terms of the form x*x, x/x, and sqrt(x), where x is a decimal number. More...
 

Detailed Description

Parse input strings to numerical values. Can resolve simple multiplications and sqrt() expressions.

Author
Finn Lasse Buessen

Function Documentation

◆ stringToDouble()

double InputParser::stringToDouble ( const std::string &  input)
inline

Parse input string to double. Resolves simple multiplications, divisions and sqrt() expressions. Input may involve terms of the form x*x, x/x, sqrt(x), and longer compositions thereof, where x is a decimal number.

Parameters
inputInput string.
Returns
double Parsed numerical value.

◆ stringToFloat()

float InputParser::stringToFloat ( const std::string &  input)
inline

Parse input string to double. Resolves simple multiplications, divisions and sqrt() expressions. Input may involve terms of the form x*x, x/x, and sqrt(x), where x is a decimal number.

Parameters
inputInput string.
Returns
float Parsed numerical value.