Lines Matching refs:path

47 StringViewType::size_type FindDriveLetter(StringViewType path) {
51 if (path.length() >= 2 && path[1] == L':' &&
52 ((path[0] >= L'A' && path[0] <= L'Z') ||
53 (path[0] >= L'a' && path[0] <= L'z'))) {
79 bool IsPathAbsolute(StringViewType path) {
81 StringType::size_type letter = FindDriveLetter(path);
84 return path.length() > letter + 1 &&
85 FilePath::IsSeparator(path[letter + 1]);
88 return path.length() > 1 && FilePath::IsSeparator(path[0]) &&
89 FilePath::IsSeparator(path[1]);
92 return path.length() > 0 && FilePath::IsSeparator(path[0]);
108 StringType::size_type FinalExtensionSeparatorPosition(const StringType& path) {
110 if (path == FilePath::kCurrentDirectory || path == FilePath::kParentDirectory)
113 return path.rfind(FilePath::kExtensionSeparator);
120 StringType::size_type ExtensionSeparatorPosition(const StringType& path) {
121 const StringType::size_type last_dot = FinalExtensionSeparatorPosition(path);
128 path.rfind(FilePath::kExtensionSeparator, last_dot - 1);
129 const StringType::size_type last_separator = path.find_last_of(
139 StringType extension(path, penultimate_dot + 1);
144 StringType extension(path, last_dot + 1);
157 // Returns true if path is "", ".", or "..".
158 bool IsEmptyOrSpecialCase(const StringType& path) {
160 if (path.empty() || path == FilePath::kCurrentDirectory ||
161 path == FilePath::kParentDirectory) {
175 FilePath::FilePath(StringViewType path) {
176 path_.assign(path);
227 // Capture path components.
254 bool FilePath::AppendRelativePath(const FilePath& child, FilePath* path) const {
288 if (path != nullptr) {
290 *path = path->Append(*child_comp);
469 // when appending to kCurrentDirectory, just return a new path for the
471 // serve no purpose other than needlessly lengthening the path, and
473 // only kCurrentDirectory when calling DirName on a single relative path
481 // Don't append a separator if the path is empty (indicating the current
482 // directory) or if the path component is empty (indicating nothing to
485 // Don't append a separator if the path still ends with a trailing
488 // Don't append a separator if the path is just a drive letter.
544 // of cases where there isn't a kParentDirectory anywhere in the path.
554 // Windows has odd, undocumented behavior with path components containing