MCPcopy Create free account
hub / github.com/Kitware/CMake / CollectMatchProperties

Method CollectMatchProperties

Source/cmFileCopier.cxx:40–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38cmFileCopier::~cmFileCopier() = default;
39
40cmFileCopier::MatchProperties cmFileCopier::CollectMatchProperties(
41 std::string const& file)
42{
43 // Match rules are case-insensitive on some platforms.
44#if defined(_WIN32) || defined(__APPLE__) || defined(__CYGWIN__)
45 std::string const file_to_match = cmSystemTools::LowerCase(file);
46#else
47 std::string const& file_to_match = file;
48#endif
49
50 // Collect properties from all matching rules.
51 bool matched = false;
52 MatchProperties result;
53 for (MatchRule& mr : this->MatchRules) {
54 if (mr.Regex.find(file_to_match)) {
55 matched = true;
56 result.Exclude |= mr.Properties.Exclude;
57 result.Permissions |= mr.Properties.Permissions;
58 }
59 }
60 if (!matched && !this->MatchlessFiles) {
61 result.Exclude = !cmSystemTools::FileIsDirectory(file);
62 }
63 return result;
64}
65
66bool cmFileCopier::SetPermissions(std::string const& toFile,
67 mode_t permissions)

Callers 1

InstallMethod · 0.95

Calls 1

findMethod · 0.45

Tested by

no test coverage detected