MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / NormalizeResourceName

Function NormalizeResourceName

src/ResourceProvider.cpp:94–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94std::string NormalizeResourceName(std::string_view resourceName) {
95 std::string normalized(resourceName);
96 for (char& ch : normalized) {
97 if (ch == '\\') {
98 ch = '/';
99 }
100 }
101 while (!normalized.empty() && normalized.front() == '/') {
102 normalized.erase(normalized.begin());
103 }
104 return normalized;
105}
106
107bool IsSafeZipResourceName(const std::string& name) {
108 if (name.empty() || IsAbsolutePath(name)) {

Callers 2

IndexMethod · 0.85
GetResourceMethod · 0.85

Calls 2

emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected