Go to the documentation of this file.
5 int main(
int argc,
char** argv)
7 const auto usage = std::string(
"Usage: ") + argv[0] +
" show|md5|fields|field-types|file|md5-text package/MessageType";
11 std::cerr << usage << std::endl;
15 std::string action{argv[1]};
17 if (action !=
"show" && action !=
"md5" && action !=
"fields" && action !=
"field-types" && action !=
"file" && action !=
"md5-text")
19 std::cerr << usage << std::endl;
23 std::string type{argv[2]};
32 std::cerr <<
"Definition for message type [" << type <<
"] could not be found!" << std::endl;
36 else if (action ==
"md5")
41 std::cerr <<
"MD5 sum for message type [" << type <<
"] could not be found!" << std::endl;
45 else if (action ==
"fields")
50 std::cerr <<
"Field names for message type [" << type <<
"] could not be found!" << std::endl;
53 for (
const auto& field : fields)
54 result += field +
"\n";
56 else if (action ==
"field-types")
61 std::cerr <<
"Field types for message type [" << type <<
"] could not be found!" << std::endl;
64 for (
const auto& field : fields)
65 result += field +
"\n";
67 else if (action ==
"file")
72 std::cerr <<
"Message proto file for message type [" << type <<
"] could not be found!" << std::endl;
76 else if (action ==
"md5-text")
81 std::cerr <<
"MD5 sum source text for message type [" << type <<
"] could not be found!" << std::endl;
std::string getMD5Text(const std::string &messageType)
Return the exact text from which the MD5 sum of the message is computed.
std::vector< std::string > getFieldNames(const std::string &messageType)
Return the names of fields of the message type (non-recursive).
std::vector< std::string > getFieldTypes(const std::string &messageType)
Return the types of fields of the message type (non-recursive).
std::string getFullDef(const std::string &messageType)
Return the full recursive definition of the message type - the same as genpy generates.
int main(int argc, char **argv)
std::string getMsgFile(const std::string &messageType)
Get the path to the .msg file corresponding to the given message type.
std::string getMD5Sum(const std::string &messageType)
Return the MD5 sum of the message type - the same as genpy generates.
rosmsg_cpp
Author(s): Martin Pecka
autogenerated on Mon Apr 17 2023 02:30:24