• Home
  • Raw
  • Download

Lines Matching full:path

55 static bool IsAbsolute(const std::string &path)  in IsAbsolute()  argument
58 return !path.empty() && path[0] == '/'; in IsAbsolute()
60 return fs::path(path).is_absolute(); in IsAbsolute()
69 return (fs::path(a) / b).string(); in JoinPaths()
73 std::string ParentPath(const std::string &path) in ParentPath() argument
76 auto pos = path.find('/'); in ParentPath()
77 return pos == std::string::npos ? path : path.substr(0, pos); in ParentPath()
79 return fs::path(path).parent_path().string(); in ParentPath()
83 static std::string MakeAbsolute(const std::string &path, const std::string &base) in MakeAbsolute() argument
85 return IsAbsolute(path) ? path : JoinPaths(base, path); in MakeAbsolute()
92 ASSERT(fs::path(base_).is_absolute()); in Pattern()
102 fs::path relative; in GetSearchRoot()
114 bool ArkTsConfig::Pattern::Match(const std::string &path) const in Match()
116 ASSERT(fs::path(path).is_absolute()); in Match()
117 fs::path value = fs::path(value_); in Match()
134 auto res = std::regex_match(path, m, std::regex(pattern)); in Match()
155 if (!Check(!basePath.empty(), "Can't resolve config path: ", extends)) { in ParseExtends()
199 if (!Check(values, "Invalid value for 'path' with key '", key, "'")) { in ParsePaths()
234 if (!Check(data != nullptr, "Invalid value for for dynamic path with key '", key, "'")) { in ParseDynamicPaths()
239 …if (!Check(langValue != nullptr, "Invalid '", LANGUAGE, "' value for dynamic path with key '", key… in ParseDynamicPaths()
244 …if (!Check(lang && lang->IsDynamic(), "Invalid '", LANGUAGE, "' value for dynamic path with key '"… in ParseDynamicPaths()
255 …if (!Check(hasDeclValue != nullptr, "Invalid '", HAS_DECL, "' value for dynamic path with key '", … in ParseDynamicPaths()
261 if (!Check(res.second, "Duplicated dynamic path '", key, "' for key '", key, "'")) { in ParseDynamicPaths()
288 static std::optional<std::string> ReadConfig(const std::string &path) in ReadConfig() argument
290 std::ifstream inputStream(path); in ReadConfig()
291 if (!Check(!inputStream.fail(), "Failed to open file: ", path)) { in ReadConfig()
304 auto path = options->get()->GetValue<JsonObject::StringT>(key); in ParseRelDir() local
305 dst = ((path != nullptr) ? *path : ""); in ParseRelDir()
387 // Remove '/' and '*' from the end of path
388 static std::string TrimPath(const std::string &path) in TrimPath() argument
390 std::string trimmedPath = path; in TrimPath()
397 std::optional<std::string> ArkTsConfig::ResolvePath(const std::string &path) const in ResolvePath()
401 size_t pos = path.rfind(trimmedAlias, 0); in ResolvePath()
403 std::string resolved = path; in ResolvePath()
414 static bool MatchExcludes(const fs::path &path, const std::vector<ArkTsConfig::Pattern> &excludes) in MatchExcludes() argument
417 if (e.Match(path.string())) { in MatchExcludes()
424 static std::vector<fs::path> GetSourceList(const std::shared_ptr<ArkTsConfig> &arktsConfig) in GetSourceList()
431 auto configDir = fs::absolute(fs::path(arktsConfig->ConfigPath())).parent_path(); in GetSourceList()
441 std::vector<fs::path> sourceList; in GetSourceList()
443 if (!Check(fs::exists(f) && fs::path(f).has_filename(), "No such file: ", f)) { in GetSourceList()
453 auto traverseRoot = fs::path(include.GetSearchRoot()); in GetSourceList()
464 if (include.Match(dirEntry.path().string()) && !MatchExcludes(dirEntry, excludes)) { in GetSourceList()
474 static fs::path Relative(const fs::path &src, const fs::path &base) in Relative()
476 fs::path tmpPath = src; in Relative()
477 fs::path relPath; in Relative()
481 return fs::path(); in Relative()
488 // Compute path to destination file and create subfolders
489 static fs::path ComputeDestination(const fs::path &src, const fs::path &rootDir, const fs::path &ou… in ComputeDestination()