fipa_acl  1.4
Classes | Public Types | Public Member Functions | List of all members
convertStringToNumberImpl Struct Reference

#include <grammar_common.h>

Classes

struct  result
 

Public Types

typedef boost::uint32_t result_type
 

Public Member Functions

template<typename T >
boost::uint32_t operator() (T arg) const
 

Detailed Description

Definition at line 465 of file grammar_common.h.

Member Typedef Documentation

typedef boost::uint32_t convertStringToNumberImpl::result_type

Definition at line 467 of file grammar_common.h.

Member Function Documentation

template<typename T >
boost::uint32_t convertStringToNumberImpl::operator() ( arg) const
inline

Definition at line 475 of file grammar_common.h.

476  {
477  std::string number(arg.begin(),arg.begin() + strlen(arg.c_str()));
478  try {
479  return boost::lexical_cast<boost::uint32_t>(number);
480  } catch(const std::bad_cast& e)
481  {
482  LOG_ERROR("ConvertString failed: '%s'", arg.c_str());
483  LOG_ERROR("String_size: '%d'", arg.size());
484  LOG_ERROR("String_length: '%d'", strlen(arg.c_str()));
485  std::string msg = "ConvertStringToNumber failed for '" + number + "' " + std::string(e.what());
486  throw std::runtime_error(msg);
487  }
488  }

The documentation for this struct was generated from the following file: