Go to the documentation of this file.
17 # pragma clang diagnostic push
20 # pragma clang diagnostic ignored "-Wkeyword-macro"
22 #include <boost/regex.hpp>
24 # pragma clang diagnostic pop
81 boost::sregex_iterator
m_it;
88 static const boost::sregex_iterator endmark;
89 if (
m_it != endmark ) {
93 static const boost::regex varexp{
"\\$\\{([^}]+)\\}" };
99 [&i](
const boost::smatch&
m ) -> std::string {
100 const std::string name = m[1];
101 const char* cname = name.c_str();
102 if ( System::isEnvSet( cname ) ) {
104 return System::getEnv( cname );
108 boost::match_default | boost::format_all );
123 AttribStringParser( std::string data,
bool expand_vars =
true ) : m_data( data ), m_expandVars( expand_vars ) {}
129 boost::sregex_iterator
parse()
const {
130 static const boost::regex exp{
"[[:space:]]*([^[:space:]]+)[[:space:]]*=[[:space:]]*'(.*?)'" };
131 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.
std::ptrdiff_t difference_type
AttribStringParser::Iterator begin(const AttribStringParser &parser)
boost::sregex_iterator parse() const
std::input_iterator_tag iterator_category
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