26 std::string::size_type ipos = 0;
27 while ((ipos = f.find (
", std::allocator", ipos)) != std::string::npos) {
28 const char* p = f.c_str() + ipos + 16;
29 while (isspace (*p)) ++p;
33 while (nest > 0 && *p) {
41 if (ipos > 0 && f[ipos-1] !=
'>') {
42 while (isspace (*p)) ++p;
44 f.erase (ipos, p-f.c_str()-ipos);
56 std::string s = str_in;
58 std::string::size_type ipos = 0;
59 while ((ipos = s.find (
"std::basic_string<", ipos)) != std::string::npos) {
60 std::string::size_type beg = ipos;
63 while (inest > 0 && ipos < s.size()) {
64 if (s[ipos] ==
'<') ++inest;
65 else if (s[ipos] ==
'>') --inest;
68 s.replace (beg, ipos-beg,
"std::string");
72 for (
size_t i = 0; i < s.size(); i++) {
73 if ((i == 0 || (s[i-1] !=
':' && !isalnum(s[i-1]))) &&
74 strncmp (s.c_str()+i,
"string", 6) == 0 &&
77 s.replace (i, 6,
"std::string");
86 std::string s = str_in;
87 for (
size_t i = 0; i < s.size()-1; i++) {
88 if (s[i] ==
' ' && (s[i+1] ==
'*' || s[i+1] ==
'&'))
96 const std::string& pat,
97 const std::string& rep)
99 std::string::size_type ipos = 0;
100 while ((ipos = s.find (pat, ipos)) != std::string::npos)
101 s.replace (ipos, pat.size(), rep);
109 do_replace (str_in,
"SG::DataProxyStorageData::pointer",
"void*");
111 s =
do_replace (s,
"SG::auxid_t",
"unsigned long");
112 s =
do_replace (s,
"auxid_t",
"unsigned long");
116 if (s.compare (0, 8,
"virtual ") == 0)
std::string do_replace(std::string s, const std::string &pat, const std::string &rep)
std::string normalizeFunctionName(const std::string &fname)
Normalize a pretty-printed C++ function name.
std::string munge_names(const std::string &str_in)
std::string munge_punct(const std::string &str_in)
std::string clean_allocator(std::string f)
Clean ‘allocator’ template arguments from the function f.
std::string munge_string_name(const std::string &str_in)
Normalize a pretty-printed C++ function name,.