• Home
  • Raw
  • Download

Lines Matching full:path

56 static bool IsAbsolute(const std::string &path)  in IsAbsolute()  argument
59 return !path.empty() && path[0] == '/'; in IsAbsolute()
61 return fs::path(path).is_absolute(); in IsAbsolute()
70 return (fs::path(a) / b).string(); in JoinPaths()
74 std::string ParentPath(const std::string &path) in ParentPath() argument
77 auto pos = path.find('/'); in ParentPath()
78 return pos == std::string::npos ? path : path.substr(0, pos); in ParentPath()
80 return fs::path(path).parent_path().string(); in ParentPath()
84 static std::string MakeAbsolute(const std::string &path, const std::string &base) in MakeAbsolute() argument
86 return IsAbsolute(path) ? path : JoinPaths(base, path); in MakeAbsolute()
93 ASSERT(fs::path(base_).is_absolute()); in Pattern()
103 fs::path relative; in GetSearchRoot()
115 bool ArkTsConfig::Pattern::Match(const std::string &path) const in Match()
117 ASSERT(fs::path(path).is_absolute()); in Match()
118 fs::path value = fs::path(value_); in Match()
135 auto res = std::regex_match(path, m, std::regex(pattern)); in Match()
157 if (!Check(!basePath.empty(), "Can't resolve config path: ", extends)) { in ParseExtends()
204 if (!Check(values, "Invalid value for 'path' with key '", key, "'")) { in ParsePaths()
239 if (!Check(data != nullptr, "Invalid value for for dynamic path with key '", key, "'")) { in ParseDynamicPaths()
244 …if (!Check(langValue != nullptr, "Invalid '", LANGUAGE, "' value for dynamic path with key '", key… in ParseDynamicPaths()
249 …if (!Check(lang && lang->IsDynamic(), "Invalid '", LANGUAGE, "' value for dynamic path with key '"… in ParseDynamicPaths()
260 …if (!Check(hasDeclValue != nullptr, "Invalid '", HAS_DECL, "' value for dynamic path with key '", … in ParseDynamicPaths()
266 if (!Check(res.second, "Duplicated dynamic path '", key, "' for key '", key, "'")) { in ParseDynamicPaths()
295 static std::optional<std::string> ReadConfig(const std::string &path) in ReadConfig() argument
297 std::ifstream inputStream(path); in ReadConfig()
298 if (!Check(!inputStream.fail(), "Failed to open file: ", path)) { in ReadConfig()
311 auto path = options->get()->GetValue<JsonObject::StringT>(key); in ParseRelDir() local
312 dst = ((path != nullptr) ? *path : ""); in ParseRelDir()
396 // Remove '/' and '*' from the end of path
397 static std::string TrimPath(const std::string &path) in TrimPath() argument
399 std::string trimmedPath = path; in TrimPath()
406 std::optional<std::string> ArkTsConfig::ResolvePath(const std::string &path) const in ResolvePath()
410 size_t pos = path.rfind(trimmedAlias, 0); in ResolvePath()
412 std::string resolved = path; in ResolvePath()
423 static bool MatchExcludes(const fs::path &path, const std::vector<ArkTsConfig::Pattern> &excludes) in MatchExcludes() argument
426 if (e.Match(path.string())) { in MatchExcludes()
433 static std::vector<fs::path> GetSourceList(const std::shared_ptr<ArkTsConfig> &arktsConfig) in GetSourceList()
440 auto configDir = fs::absolute(fs::path(arktsConfig->ConfigPath())).parent_path(); in GetSourceList()
450 std::vector<fs::path> sourceList; in GetSourceList()
452 if (!Check(fs::exists(f) && fs::path(f).has_filename(), "No such file: ", f)) { in GetSourceList()
462 auto traverseRoot = fs::path(include.GetSearchRoot()); in GetSourceList()
473 if (include.Match(dirEntry.path().string()) && !MatchExcludes(dirEntry, excludes)) { in GetSourceList()
483 static fs::path Relative(const fs::path &src, const fs::path &base) in Relative()
485 fs::path tmpPath = src; in Relative()
486 fs::path relPath; in Relative()
490 return fs::path(); in Relative()
497 // Compute path to destination file and create subfolders
498 static fs::path ComputeDestination(const fs::path &src, const fs::path &rootDir, const fs::path &ou… in ComputeDestination()