OpenMS
Loading...
Searching...
No Matches
StringUtilsHelper Class Reference

#include <OpenMS/DATASTRUCTURES/StringUtils.h>

Collaboration diagram for StringUtilsHelper:
[legend]

Classes

struct  real_policies_NANfixed_
 

Static Public Member Functions

static Int32 toInt32 (const std::string &s)
 Parse int32 from string (leading/trailing whitespace allowed)
 
static Int64 toInt64 (const std::string &s)
 Parse int64 from string (leading/trailing whitespace allowed)
 
static float toFloat (const std::string &s)
 Parse float from string (leading/trailing whitespace allowed)
 
static double toDouble (const std::string &s)
 Parse double from string (leading/trailing whitespace allowed)
 
template<typename IteratorT >
static bool extractDouble (IteratorT &begin, const IteratorT &end, double &target)
 
template<typename IteratorT >
static bool extractInt (IteratorT &begin, const IteratorT &end, int &target)
 

Static Private Attributes

static boost::spirit::qi::real_parser< double, real_policies_NANfixed_< double > > parse_double_
 
static boost::spirit::qi::real_parser< float, real_policies_NANfixed_< float > > parse_float_
 
static boost::spirit::qi::int_parser parse_int_
 

Member Function Documentation

◆ extractDouble()

template<typename IteratorT >
static bool extractDouble ( IteratorT &  begin,
const IteratorT &  end,
double &  target 
)
inlinestatic

Parse a double starting at begin; advances begin on success. Whitespace is NOT consumed. Returns false if no double found.

Referenced by OpenMS::StringUtils::extractDouble().

◆ extractInt()

template<typename IteratorT >
static bool extractInt ( IteratorT &  begin,
const IteratorT &  end,
int &  target 
)
inlinestatic

Parse an int starting at begin; advances begin on success. Whitespace is NOT consumed. Returns false if no int found.

Referenced by OpenMS::StringUtils::extractInt().

◆ toDouble()

static double toDouble ( const std::string &  s)
static

Parse double from string (leading/trailing whitespace allowed)

Referenced by OpenMS::StringUtils::toDouble().

◆ toFloat()

static float toFloat ( const std::string &  s)
static

Parse float from string (leading/trailing whitespace allowed)

Referenced by OpenMS::StringUtils::toFloat().

◆ toInt32()

static Int32 toInt32 ( const std::string &  s)
static

Parse int32 from string (leading/trailing whitespace allowed)

Referenced by OpenMS::StringUtils::toInt32().

◆ toInt64()

static Int64 toInt64 ( const std::string &  s)
static

Parse int64 from string (leading/trailing whitespace allowed)

Referenced by OpenMS::StringUtils::toInt64().

Member Data Documentation

◆ parse_double_

boost::spirit::qi::real_parser<double, real_policies_NANfixed_<double> > parse_double_
staticprivate

◆ parse_float_

boost::spirit::qi::real_parser<float, real_policies_NANfixed_<float> > parse_float_
staticprivate

◆ parse_int_

boost::spirit::qi::int_parser parse_int_
staticprivate