Developer Documentation
NumberParsing.hh File Reference
#include "OpenFlipper/common/GlobalDefines.hh"
#include <QTextStream>

Go to the source code of this file.

Functions

double Utils::getDouble (QTextStream &_source)
 getDouble parses a QTextStream for a double. the double has to be the next word in the QTextStream. if parsing fails, the standard extraction is performed and returned. More...
 
float Utils::getFloat (QTextStream &_source)
 getFloat parses a QTextStream for a float. the float has to be the next word in the QTextStream. if parsing fails, the standard extraction is performed and returned. More...
 
float Utils::getFloat (std::istream &_source)
 getFloat parses a std::istream for a float. the float has to be the next word in the std::istream. if parsing fails, the standard extraction is performed and returned. More...
 

Detailed Description

This file contains functions which can be used to parse numbers from streams. The algorithms are designed to parse Numbers very fast, however for numbers with scientific notation the performance may not improve. (e.g. parsing 123e10 will be slower with this algorithm)

Definition in file NumberParsing.hh.

Function Documentation

◆ getDouble()

DLLEXPORT double Utils::getDouble ( QTextStream &  _source)

getDouble parses a QTextStream for a double. the double has to be the next word in the QTextStream. if parsing fails, the standard extraction is performed and returned.

Parameters
_sourceThe QTextStream that holds at least one double.
Returns
double the extracted double.

Definition at line 178 of file NumberParsing.cc.

◆ getFloat() [1/2]

DLLEXPORT float Utils::getFloat ( QTextStream &  _source)

getFloat parses a QTextStream for a float. the float has to be the next word in the QTextStream. if parsing fails, the standard extraction is performed and returned.

Parameters
_sourceThe QTextStream that holds at least one float.
Returns
float the extracted float.

Definition at line 49 of file NumberParsing.cc.

◆ getFloat() [2/2]

DLLEXPORT float Utils::getFloat ( std::istream &  _source)

getFloat parses a std::istream for a float. the float has to be the next word in the std::istream. if parsing fails, the standard extraction is performed and returned.

Parameters
_sourceThe std::istream that holds at least one float.
Returns
float the extracted float.

Definition at line 111 of file NumberParsing.cc.