Implement no_demangle in various get_... functions
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
eb2d17c066
commit
8844880edd
1 changed files with 8 additions and 4 deletions
|
@ -2242,7 +2242,7 @@ static rmw_ret_t get_endpoint_names_and_types_by_node(
|
|||
std::regex("^" + std::string(ros_topic_prefix) + "(/.*)", std::regex::extended);
|
||||
const auto re_typ = std::regex("^(.*::)dds_::(.*)_$", std::regex::extended);
|
||||
const auto filter_and_map =
|
||||
[re_tp, re_typ, guids, node_name](const dds_builtintopic_endpoint_t & sample,
|
||||
[re_tp, re_typ, guids, node_name, no_demangle](const dds_builtintopic_endpoint_t & sample,
|
||||
std::string & topic_name, std::string & type_name) -> bool {
|
||||
std::cmatch cm_tp, cm_typ;
|
||||
if (node_name != nullptr && guids.count(sample.participant_key) == 0) {
|
||||
|
@ -2252,11 +2252,15 @@ static rmw_ret_t get_endpoint_names_and_types_by_node(
|
|||
re_tp) || !std::regex_search(sample.type_name, cm_typ, re_typ))
|
||||
{
|
||||
return false;
|
||||
} else {
|
||||
topic_name = std::string(cm_tp[1]);
|
||||
if (no_demangle) {
|
||||
type_name = std::string(type_name);
|
||||
} else {
|
||||
std::string demangled_type = std::regex_replace(std::string(cm_typ[1]), std::regex(
|
||||
"::"), "/");
|
||||
topic_name = std::string(cm_tp[1]);
|
||||
type_name = std::string(demangled_type) + std::string(cm_typ[2]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue