Go to the documentation of this file.
11 #ifndef _ATTRIB_STRING_PARSER_H_
12 #define _ATTRIB_STRING_PARSER_H_
18 # pragma clang diagnostic push
21 # pragma clang diagnostic ignored "-Wkeyword-macro"
23 #include <boost/regex.hpp>
25 # pragma clang diagnostic pop
82 boost::sregex_iterator
m_it;
89 static const boost::sregex_iterator endmark;
90 if (
m_it != endmark ) {
94 static const boost::regex varexp{
"\\$\\{([^}]+)\\}" };
101 const std::string name = m[1];
102 const char* cname = name.c_str();
103 if ( System::isEnvSet( cname ) ) {
105 return System::getEnv( cname );
109 boost::match_default | boost::format_all );
130 boost::sregex_iterator
parse()
const {
131 static const boost::regex exp{
"[[:space:]]*([^[:space:]]+)[[:space:]]*=[[:space:]]*'(.*?)'" };
132 return boost::sregex_iterator(
begin( m_data ),
end( m_data ), exp );
bool operator!=(const Iterator &other)
Iterator(Iterator &&other)
Iterator(const Iterator &other)
bool operator==(const Iterator &other)
boost::sregex_iterator m_it
Wrapped boost::sregex_iterator instance.
AttribStringParser::Iterator begin(const AttribStringParser &parser)
boost::sregex_iterator parse() const
Iterator(const boost::sregex_iterator &it, bool expand_vars)
Simple class to wrap tag/value pairs.
AttribStringParser::Iterator end(const AttribStringParser &)
Iterator to loop over the tag/value pairs in the attribute string.
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
AttribStringParser(std::string data, bool expand_vars=true)
Initialize the parsing of an attribute string.
Attrib m_attrib
Cached Attrib instance.
Parse attribute strings allowing iteration over the various attributes.
void i_setAttrib()
Helper method used to update the cached Attrib instance when dereferencing the iterator.
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator