24 std::string const formatted = std::regex_replace(input, exp, format);
25 if (formatted == input) {
46 auto const asize = toRemove.size();
47 auto const initDepth = (toRemove.back() ==
'<') ? 1 : 0;
51 char const*
const delimiters =
"<>";
52 auto index = std::string::npos;
53 while ((
index = name.find(toRemove)) != std::string::npos) {
54 int depth = initDepth;
55 auto inx =
index + asize;
56 while ((inx = name.find_first_of(delimiters, inx)) != std::string::npos) {
57 if (name[inx] ==
'<') {
83 auto const asize = toBeMoved.size();
84 auto index = std::string::npos;
85 while ((
index = name.find(toBeMoved)) != std::string::npos) {
86 name.erase(
index, asize);
88 for (std::string::size_type inx =
index - 1; inx > 0; --inx) {
89 char const c = name[inx];
92 }
else if (depth > 0) {
96 }
else if (c ==
'<' || c ==
',') {
97 name.insert(inx + 1,
"const ");
140 static std::regex
const ns_regex(
"std::__(1|cxx11)::");
142 reformat(name, ns_regex, ns_format);
150 "std::basic_string<char, std::char_traits<char>, std::allocator<char> >",
153 name,
"std::basic_string<char, std::char_traits<char> >",
"std::string");
165 translateInlineNamespace(name);
181 removeParameter(name,
",std::allocator<"s);
183 removeParameter(name,
",std::less<"s);
185 removeParameter(name,
",std::char_traits<"s);
188 static std::regex
const bs_regex(
"std::basic_string<char>\\s*"s);
189 reformat(name, bs_regex,
"std::string"s);
192 constBeforeIdentifier(name);
198 static std::regex
const bk_regex(
"([_a-zA-Z0-9])( +)>");
200 reformat(name, bk_regex, bk_format);
210 static std::regex
const ul_regex(
"(.*[<,][0-9]+)[ul]l*([,>].*)"s);
211 reformat(name, ul_regex,
"$1$2"s);
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
bool replace_all(std::string &in, std::string const &from, std::string const &to)
Replace all occurrences of from in string with to.
std::string uniform_type_name(std::type_info const &tid)