ProteoWizard
Namespaces | Macros | Functions
optimized_lexical_cast.hpp File Reference
#include <cstdlib>
#include <cerrno>
#include <boost/lexical_cast.hpp>
#include <boost/logic/tribool.hpp>

Go to the source code of this file.

Namespaces

namespace  boost
 

Macros

#define STRTOD(x, y)   strtod((x), (y))
 
#define ATOF(x)   atof(x)
 
#define OPTIMIZED_LEXICAL_CAST(toType)
 

Functions

template<typename toType >
toType boost::lexical_cast (const std::string &str, bool &success)
 
template<>
float boost::lexical_cast (const std::string &str, bool &success)
 
template<>
double boost::lexical_cast (const std::string &str, bool &success)
 
template<>
int boost::lexical_cast (const std::string &str, bool &success)
 
template<>
long boost::lexical_cast (const std::string &str, bool &success)
 
template<>
unsigned int boost::lexical_cast (const std::string &str, bool &success)
 
template<>
unsigned long boost::lexical_cast (const std::string &str, bool &success)
 
template<>
long long boost::lexical_cast (const std::string &str, bool &success)
 
template<>
unsigned long long boost::lexical_cast (const std::string &str, bool &success)
 
template<>
bool boost::lexical_cast (const std::string &str)
 
template<>
boost::logic::tribool boost::lexical_cast (const std::string &str)
 

Macro Definition Documentation

◆ STRTOD

#define STRTOD (   x,
  y 
)    strtod((x), (y))

Definition at line 53 of file optimized_lexical_cast.hpp.

◆ ATOF

#define ATOF (   x)    atof(x)

Definition at line 54 of file optimized_lexical_cast.hpp.

◆ OPTIMIZED_LEXICAL_CAST

#define OPTIMIZED_LEXICAL_CAST (   toType)
Value:
template<> inline toType lexical_cast(const std::string& str) { \
bool success; \
toType value = lexical_cast<toType>(str, success); \
if (!success) \
throw bad_lexical_cast(); \
return value; \
}

Definition at line 57 of file optimized_lexical_cast.hpp.

58 { \
59 bool success; \
60 toType value = lexical_cast<toType>(str, success); \
61 if (!success) \
62 throw bad_lexical_cast(); \
63 return value; \
64 }
PWIZ_API_DECL std::string value(const std::string &id, const std::string &name)
convenience function to extract a named value from an id string