Lines Matching refs:path

77 bool PartialMatch(const std::filesystem::path& pattern, const std::filesystem::path& path_prefix) {  in PartialMatch()
78 for (std::filesystem::path::const_iterator pattern_it = pattern.begin(), in PartialMatch()
97 bool FullMatchRecursive(const std::filesystem::path& pattern, in FullMatchRecursive()
98 std::filesystem::path::const_iterator pattern_it, in FullMatchRecursive()
99 const std::filesystem::path& path, in FullMatchRecursive() argument
100 std::filesystem::path::const_iterator path_it, in FullMatchRecursive()
102 if (pattern_it == pattern.end() && path_it == path.end()) { in FullMatchRecursive()
110 std::filesystem::path::const_iterator next_pattern_it = pattern_it; in FullMatchRecursive()
112 pattern, ++next_pattern_it, path, path_it, /*double_asterisk_visited=*/true) || in FullMatchRecursive()
113 (path_it != path.end() && FullMatchRecursive(pattern, pattern_it, path, ++path_it)); in FullMatchRecursive()
115 if (path_it == path.end()) { in FullMatchRecursive()
121 return FullMatchRecursive(pattern, ++pattern_it, path, ++path_it); in FullMatchRecursive()
125 bool FullMatch(const std::filesystem::path& pattern, const std::filesystem::path& path) { in FullMatch() argument
126 return FullMatchRecursive(pattern, pattern.begin(), path, path.begin()); in FullMatch()
129 void MatchGlobRecursive(const std::vector<std::filesystem::path>& patterns, in MatchGlobRecursive()
130 const std::filesystem::path& root_dir, in MatchGlobRecursive()
138 if (std::none_of(patterns.begin(), patterns.end(), std::bind(PartialMatch, _1, entry.path()))) { in MatchGlobRecursive()
145 std::any_of(patterns.begin(), patterns.end(), std::bind(FullMatch, _1, entry.path()))) { in MatchGlobRecursive()
146 results->push_back(entry.path()); in MatchGlobRecursive()
152 LOG(ERROR) << ART_FORMAT("Unable to lstat '{}': {}", entry.path().string(), ec2.message()); in MatchGlobRecursive()
165 std::vector<std::filesystem::path> parsed_patterns; in Glob()
179 bool PathStartsWith(std::string_view path, std::string_view prefix) { in PathStartsWith() argument
180 CHECK(!prefix.empty() && !path.empty() && prefix[0] == '/' && path[0] == '/') in PathStartsWith()
181 << ART_FORMAT("path={}, prefix={}", path, prefix); in PathStartsWith()
183 return path.starts_with(prefix) && in PathStartsWith()
184 (path.length() == prefix.length() || path[prefix.length()] == '/'); in PathStartsWith()
209 Result<std::vector<FstabEntry>> GetProcMountsAncestorsOfPath(std::string_view path) { in GetProcMountsAncestorsOfPath() argument
211 [&](std::string_view mount_point) { return PathStartsWith(path, mount_point); }); in GetProcMountsAncestorsOfPath()
214 Result<std::vector<FstabEntry>> GetProcMountsDescendantsOfPath(std::string_view path) { in GetProcMountsDescendantsOfPath() argument
216 [&](std::string_view mount_point) { return PathStartsWith(mount_point, path); }); in GetProcMountsDescendantsOfPath()