LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::dbid_parser Struct Reference

#include "tokens.h"

Inheritance diagram for fhicl::dbid_parser:

Classes

struct  attribute
 

Public Member Functions

template<typename Iterator , typename Context , typename Skipper , typename Attribute >
bool parse (Iterator &first, Iterator const &last, Context &, Skipper const &skipper, Attribute &attr) const
 
template<typename Context >
boost::spirit::info what (Context &) const
 

Detailed Description

Definition at line 279 of file tokens.h.

Member Function Documentation

template<typename Iterator , typename Context , typename Skipper , typename Attribute >
bool fhicl::dbid_parser::parse ( Iterator &  first,
Iterator const &  last,
Context &  ,
Skipper const &  skipper,
Attribute &  attr 
) const
inline

Definition at line 292 of file tokens.h.

References fhicl::ParameterSetID::max_str_size(), and fhicl::maximally_munched_number().

297  {
298  boost::spirit::qi::skip_over(first, last, skipper);
299 
300  static std::string const allowed{"0123456789abcdefABCDEF"};
301  Iterator it = first;
302 
303  if (it == last)
304  return false;
305 
306  while (it != last && allowed.find(*it) != std::string::npos)
307  ++it;
308 
309  if (it != last && !maximally_munched_number(*it))
310  return false;
311 
312  Attribute result(first, it);
313  if (result.size() != ParameterSetID::max_str_size())
314  return false;
315 
316  first = it;
317  boost::spirit::traits::assign_to(result, attr);
318  return true;
319  }
static std::size_t max_str_size()
bool maximally_munched_number(char const ch)
Definition: tokens.h:35
template<typename Context >
boost::spirit::info fhicl::dbid_parser::what ( Context &  ) const
inline

Definition at line 324 of file tokens.h.

325  {
326  return boost::spirit::info{"fhicl::dbid"};
327  }

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