35 #include <boost/algorithm/string.hpp> 36 #include <boost/utility/string_ref.hpp> 37 #include <boost/utility/string_ref.hpp> 39 #include <boost/regex.hpp> 40 #include <boost/algorithm/string/regex.hpp> 46 std::istringstream messageDescriptor(msg_def);
47 boost::match_results<std::string::const_iterator> what;
49 for (std::string line; std::getline(messageDescriptor, line,
'\n');)
51 std::string::const_iterator begin = line.begin(), end = line.end();
53 static const boost::regex regex(
"(^\\s*$|^\\s*#)");
56 if (boost::regex_search(begin, end, what, regex))
62 line.erase(line.begin(), std::find_if(line.begin(), line.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
64 if (line.compare(0, 5,
"MSG: ") == 0)
84 for (
const ROSType* known_type : all_types)
const ROSField & field(size_t index) const
Get field by index.
const boost::string_ref & pkgName() const
ex.: geometry_msgs/Pose -> "geometry_msgs"
ROSMessage(const std::string &msg_def)
void setPkgName(boost::string_ref new_pkg)
const ROSType & type() const
std::vector< ROSField > _fields
const boost::string_ref & msgName() const
ex.: geometry_msgs/Pose -> "Pose"
A ROSMessage will contain one or more ROSField(s). Each field is little more than a name / type pair...
void updateMissingPkgNames(const std::vector< const ROSType *> &all_types)