ProteoWizard
Namespaces | Functions
boost Namespace Reference

Namespaces

 date_time
 

Functions

void assertion_failed (char const *expr, char const *function, char const *file, long line)
 
void assertion_failed_msg (char const *expr, char const *msg, char const *function, char const *file, long line)
 
template<typename toType >
toType lexical_cast (const std::string &str, bool &success)
 
template<>
float lexical_cast (const std::string &str, bool &success)
 
template<>
bool lexical_cast (const std::string &str)
 

Function Documentation

◆ assertion_failed()

void boost::assertion_failed ( char const *  expr,
char const *  function,
char const *  file,
long  line 
)
inline

Definition at line 114 of file Exception.hpp.

115  {
116  std::ostringstream oss;
117  oss << "[" << file << ":" << line << "] Assertion failed: " << expr;
118  throw std::runtime_error(oss.str());
119  }

◆ assertion_failed_msg()

void boost::assertion_failed_msg ( char const *  expr,
char const *  msg,
char const *  function,
char const *  file,
long  line 
)
inline

Definition at line 121 of file Exception.hpp.

122  {
123  std::ostringstream oss;
124  oss << "[" << file << ":" << line << "] Assertion failed: " << expr << " (" << msg << ")";
125  throw std::runtime_error(oss.str());
126  }

◆ lexical_cast() [1/3]

template<typename toType >
toType boost::lexical_cast ( const std::string &  str,
bool &  success 
)
inline

Definition at line 70 of file optimized_lexical_cast.hpp.

71  {
72  // error: new overload needed below
73  throw std::logic_error("BUG: new overload needed");
74  }

◆ lexical_cast() [2/3]

template<>
unsigned long long boost::lexical_cast ( const std::string &  str,
bool &  success 
)
inline

Definition at line 77 of file optimized_lexical_cast.hpp.

78  {
79  errno = 0;
80  success = true;
81  const char* stringToConvert = str.c_str();
82  const char* endOfConversion = stringToConvert;
83  float value = (float) STRTOD( stringToConvert, const_cast<char**>(&endOfConversion) );
84  if( value == 0.0f && stringToConvert == endOfConversion ) // error: conversion could not be performed
85  success = false;
86  return value;
87  }

References STRTOD, and pwiz::msdata::id::value().

◆ lexical_cast() [3/3]

template<>
boost::logic::tribool boost::lexical_cast ( const std::string &  str)
inline

Definition at line 203 of file optimized_lexical_cast.hpp.

204  {
205  if (str == "0" || str == "false")
206  return false;
207  return true;
208  }
pwiz::msdata::id::value
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
STRTOD
#define STRTOD(x, y)
Definition: optimized_lexical_cast.hpp:53