MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / toNativeSeparators

Method toNativeSeparators

lib/path.cpp:71–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71std::string Path::toNativeSeparators(std::string path)
72{
73#if defined(_WIN32)
74 constexpr char separ = '/';
75 constexpr char native = '\\';
76#else
77 constexpr char separ = '\\';
78 constexpr char native = '/';
79#endif
80 std::replace(path.begin(), path.end(), separ, native);
81 return path;
82}
83
84std::string Path::fromNativeSeparators(std::string path)
85{

Callers

nothing calls this directly

Calls 3

replaceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected