MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / removeForbiddenCharacters

Method removeForbiddenCharacters

common/common.cpp:58–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58std::string StringUtils::removeForbiddenCharacters(std::string src)
59{
60 static const std::string illegalChars = ".,!\\/:?*\"<>|";
61 for (size_t i = 0, sz = src.length(); i < sz; i++) {
62 if (illegalChars.find(src[i]) != std::string::npos) {
63 src[i] = ' ';
64 }
65 }
66
67 size_t i;
68 for (i = src.length() - 1; i > 0 && src[i] == ' '; i--)
69 ;
70 src.erase(i + 1, src.length() - i);
71
72 return src;
73}
74
75std::string StringUtils::format(const std::string fmt_str, ...)
76{

Callers

nothing calls this directly

Calls 2

findMethod · 0.80
eraseMethod · 0.45

Tested by

no test coverage detected