• Home
  • Raw
  • Download

Lines Matching refs:filepath

269 std::string StripExtension(const std::string &filepath) {  in StripExtension()  argument
270 size_t i = filepath.find_last_of('.'); in StripExtension()
271 return i != std::string::npos ? filepath.substr(0, i) : filepath; in StripExtension()
274 std::string GetExtension(const std::string &filepath) { in GetExtension() argument
275 size_t i = filepath.find_last_of('.'); in GetExtension()
276 return i != std::string::npos ? filepath.substr(i + 1) : ""; in GetExtension()
279 std::string StripPath(const std::string &filepath) { in StripPath() argument
280 size_t i = filepath.find_last_of(PathSeparatorSet); in StripPath()
281 return i != std::string::npos ? filepath.substr(i + 1) : filepath; in StripPath()
284 std::string StripFileName(const std::string &filepath) { in StripFileName() argument
285 size_t i = filepath.find_last_of(PathSeparatorSet); in StripFileName()
286 return i != std::string::npos ? filepath.substr(0, i) : ""; in StripFileName()
289 std::string StripPrefix(const std::string &filepath, in StripPrefix() argument
291 if (!strncmp(filepath.c_str(), prefix_to_remove.c_str(), in StripPrefix()
293 return filepath.substr(prefix_to_remove.size()); in StripPrefix()
295 return filepath; in StripPrefix()
300 std::string filepath = path; in ConCatPathFileName() local
301 if (filepath.length()) { in ConCatPathFileName()
302 char &filepath_last_character = filepath.back(); in ConCatPathFileName()
306 filepath += kPathSeparator; in ConCatPathFileName()
309 filepath += filename; in ConCatPathFileName()
311 if (filepath[0] == '.' && filepath[1] == kPathSeparator) { in ConCatPathFileName()
312 filepath.erase(0, 2); in ConCatPathFileName()
314 return filepath; in ConCatPathFileName()
326 void EnsureDirExists(const std::string &filepath) { in EnsureDirExists() argument
327 auto parent = StripFileName(filepath); in EnsureDirExists()
332 (void)_mkdir(filepath.c_str()); in EnsureDirExists()
334 mkdir(filepath.c_str(), S_IRWXU|S_IRGRP|S_IXGRP); in EnsureDirExists()
343 std::string AbsolutePath(const std::string &filepath) { in AbsolutePath() argument
347 return filepath; in AbsolutePath()
351 return GetFullPathNameA(filepath.c_str(), MAX_PATH, abs_path, nullptr) in AbsolutePath()
353 char *abs_path_temp = realpath(filepath.c_str(), nullptr); in AbsolutePath()
363 : filepath; in AbsolutePath()
369 const std::string &filepath) { in RelativeToRootPath() argument
372 std::string absolute_filepath = PosixPath(AbsolutePath(filepath)); in RelativeToRootPath()