Lines Matching full:filepath
5 // FilePath is a container for pathnames stored in a platform's native string
26 // FilePath objects are intended to be used anywhere paths are. An
27 // application may pass FilePath objects around internally, masking the
30 // OpenFile(const FilePath &) function may be made available, allowing all
39 // Several methods are available to perform common operations on a FilePath
42 // to an existing FilePath object (Append). These methods are highly
48 // instances of FilePath objects, and are therefore safe to use on const
51 // To aid in initialization of FilePath objects from string literals, a
58 // Because a FilePath object should not be instantiated at the global scope,
59 // instead, use a FilePath::CharType[] and initialize it with
60 // FILE_PATH_LITERAL. At runtime, a FilePath object can be created from the
63 // | const FilePath::CharType kLogFileName[] = FILE_PATH_LITERAL("log.txt");
66 // | FilePath log_file_path(kLogFileName);
82 // with two leading slashes, but FilePath handles this case properly
83 // in case it ever comes across such a system. FilePath needs this support
94 // equivalent. Since the OS treats these paths specially, FilePath needs
96 // FilePath treats c://, c:\\, //, and \\ all equivalently.
132 class BASE_EXPORT FilePath {
165 FilePath();
166 FilePath(const FilePath& that);
167 explicit FilePath(const StringType& path);
168 ~FilePath();
169 FilePath& operator=(const FilePath& that);
171 bool operator==(const FilePath& that) const;
173 bool operator!=(const FilePath& that) const;
176 bool operator<(const FilePath& that) const {
192 void GetComponents(std::vector<FilePath::StringType>* components) const;
194 // Returns true if this FilePath is a strict parent of the |child|. Absolute
199 bool IsParent(const FilePath& child) const;
209 bool AppendRelativePath(const FilePath& child, FilePath* path) const;
211 // Returns a FilePath corresponding to the directory containing the path
213 // only contains one component, returns a FilePath identifying
215 // returns a FilePath identifying the root directory.
216 FilePath DirName() const WARN_UNUSED_RESULT;
218 // Returns a FilePath corresponding to the last path component of this
220 // the root directory, returns a FilePath identifying the root directory;
222 FilePath BaseName() const WARN_UNUSED_RESULT;
248 FilePath RemoveExtension() const WARN_UNUSED_RESULT;
252 FilePath RemoveFinalExtension() const WARN_UNUSED_RESULT;
261 FilePath InsertBeforeExtension(
263 FilePath InsertBeforeExtensionASCII(
266 // Adds |extension| to |file_name|. Returns the current FilePath if
268 FilePath AddExtension(
275 FilePath ReplaceExtension(
282 // Returns a FilePath by appending a separator and the supplied path
285 // If this object's path is kCurrentDirectory, a new FilePath corresponding
288 FilePath Append(const StringType& component) const WARN_UNUSED_RESULT;
289 FilePath Append(const FilePath& component) const WARN_UNUSED_RESULT;
297 FilePath AppendASCII(const base::StringPiece& component)
300 // Returns true if this FilePath contains an absolute path. On Windows, an
309 // Returns a copy of this FilePath that ends with a trailing separator. If
310 // the input path is empty, an empty FilePath will be returned.
311 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT;
313 // Returns a copy of this FilePath that does not end with a trailing
315 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT;
317 // Returns true if this FilePath contains any attempt to reference a parent
328 // This should only be used for cases where the FilePath is representing a
350 // Returns a FilePath
358 static FilePath FromUTF8Unsafe(const std::string& utf8);
361 static FilePath FromUTF16Unsafe(const string16& utf16);
368 FilePath NormalizePathSeparators() const;
395 static StringType GetHFSDecomposedForm(const FilePath::StringType& string);
428 BASE_EXPORT extern void PrintTo(const base::FilePath& path, std::ostream* out);
430 // Macros for string literal initialization of FilePath::CharType[], and for
431 // using a FilePath::CharType[] in a printf-style format string.
442 // Provide a hash function so that hash_sets and maps can contain FilePath
448 struct hash<base::FilePath> {
449 size_t operator()(const base::FilePath& f) const {
450 return hash<base::FilePath::StringType>()(f.value());
456 inline size_t hash_value(const base::FilePath& f) {