Skip to content

Commit

Permalink
Old compilers need string explicitly
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Luis Rivero <[email protected]>
  • Loading branch information
j-rivero committed Jun 21, 2021
1 parent 8e2f353 commit 338d966
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1111,23 +1111,23 @@ void addNestedModel(ElementPtr _sdf, ElementPtr _includeSDF)
{
std::string old_name(iter->first);
std::string name_with_nested_prefix(iter->second);
replace_all(str, "\"" + old_name + "\"",
"\"" + name_with_nested_prefix + "\"");
replace_all(str, "'" + old_name + "'",
"'" + name_with_nested_prefix + "'");
replace_all(str, ">" + old_name + "<",
">" + name_with_nested_prefix + "<");
replace_all(str, std::string("\"") + old_name + "\"",
std::string("\"") + name_with_nested_prefix + "\"");
replace_all(str, std::string("'") + old_name + "'",
std::string("'") + name_with_nested_prefix + "'");
replace_all(str, std::string(">") + old_name + "<",
std::string(">") + name_with_nested_prefix + "<");
// Deal with nested model inside other nested model and already with
// '::component::' entries in the name
// Case A. ::component1::iter.first::component2
replace_all(str, "::" + old_name + "::",
"::" + name_with_nested_prefix + "::");
// ::namespace:: entries in the name
// Case A. ::namespace1::iter.first::namespace2
replace_all(str, std::string("::") + old_name + "::",
std::string("::") + name_with_nested_prefix + "::");
// Case B. >iter.first::component
replace_all(str, ">" + old_name + "::",
">" + name_with_nested_prefix + "::");
replace_all(str, std::string(">") + old_name + "::",
std::string(">") + name_with_nested_prefix + "::");
// Case C.::component::iter.first<
replace_all(str, "::" + old_name + "<",
"::" + name_with_nested_prefix + "<");
replace_all(str, std::string("::") + old_name + "<",
std::string("::") + name_with_nested_prefix + "<");
// remove duplicate prefixes introduced by the logic above (cases
// A,B,C) if the full name (iter.second) was used in the original SDF: (i.e
// iter.second::component)
Expand Down

0 comments on commit 338d966

Please sign in to comment.