MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / IsSubRelative

Function IsSubRelative

CodeFormat/src/FormatContext.cpp:25–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25bool IsSubRelative(const std::filesystem::path &path, const std::filesystem::path &base) {
26 auto relative = std::filesystem::relative(path, base);
27 auto relativeString = relative.string();
28 if (relativeString.empty()) {
29 return false;
30 }
31 if (relativeString == ".") {
32 return true;
33 }
34 return !relativeString.starts_with(".");
35}
36
37void FormatContext::SetOutputFilePath(std::string_view path) {
38 _outPath = std::string(path);

Callers 1

Calls 2

stringMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected