00001 #include "CondCore/Utilities/interface/CSVHeaderLineParser.h" 00002 #include <boost/spirit/core.hpp> 00003 #include <boost/spirit/actor/push_back_actor.hpp> 00004 #include <boost/spirit/utility/lists.hpp> 00005 using namespace boost::spirit; 00006 00007 bool CSVHeaderLineParser::parse( const std::string& inputLine){ 00008 if(inputLine.empty()) return true; 00009 m_result.clear(); 00010 boost::spirit::rule<> list_parser; 00011 list_parser=list_p((*print_p)[push_back_a(m_result)],','); 00012 parse_info<> result=boost::spirit::parse(inputLine.c_str(),list_parser); 00013 if(result.full){ 00014 return true; 00015 } 00016 return false; 00017 } 00018 00019 std::vector<std::string> CSVHeaderLineParser::result() const{ 00020 return m_result; 00021 }