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.
144 class BASE_EXPORT FilePath {
178 FilePath();
179 FilePath(const FilePath& that);
180 explicit FilePath(StringPieceType path);
181 ~FilePath();
182 FilePath& operator=(const FilePath& that);
184 bool operator==(const FilePath& that) const;
186 bool operator!=(const FilePath& that) const;
189 bool operator<(const FilePath& that) const {
212 void GetComponents(std::vector<FilePath::StringType>* components) const;
214 // Returns true if this FilePath is a strict parent of the |child|. Absolute
219 bool IsParent(const FilePath& child) const;
229 bool AppendRelativePath(const FilePath& child, FilePath* path) const;
231 // Returns a FilePath corresponding to the directory containing the path
233 // only contains one component, returns a FilePath identifying
235 // returns a FilePath identifying the root directory.
236 FilePath DirName() const WARN_UNUSED_RESULT;
238 // Returns a FilePath corresponding to the last path component of this
240 // the root directory, returns a FilePath identifying the root directory;
242 FilePath BaseName() const WARN_UNUSED_RESULT;
268 FilePath RemoveExtension() const WARN_UNUSED_RESULT;
272 FilePath RemoveFinalExtension() const WARN_UNUSED_RESULT;
281 FilePath InsertBeforeExtension(
283 FilePath InsertBeforeExtensionASCII(
286 // Adds |extension| to |file_name|. Returns the current FilePath if
288 FilePath AddExtension(StringPieceType extension) const WARN_UNUSED_RESULT;
294 FilePath ReplaceExtension(StringPieceType extension) const WARN_UNUSED_RESULT;
300 // Returns a FilePath by appending a separator and the supplied path
303 // If this object's path is kCurrentDirectory, a new FilePath corresponding
306 FilePath Append(StringPieceType component) const WARN_UNUSED_RESULT;
307 FilePath Append(const FilePath& component) const WARN_UNUSED_RESULT;
315 FilePath AppendASCII(StringPiece component) const WARN_UNUSED_RESULT;
317 // Returns true if this FilePath contains an absolute path. On Windows, an
326 // Returns a copy of this FilePath that ends with a trailing separator. If
327 // the input path is empty, an empty FilePath will be returned.
328 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT;
330 // Returns a copy of this FilePath that does not end with a trailing
332 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT;
334 // Returns true if this FilePath contains an attempt to reference a parent
345 // This should only be used for cases where the FilePath is representing a
367 // Returns a FilePath object from a path name in UTF-8. This function
375 static FilePath FromUTF8Unsafe(const std::string& utf8);
378 static FilePath FromUTF16Unsafe(const string16& utf16);
385 FilePath NormalizePathSeparators() const;
389 FilePath NormalizePathSeparatorsTo(CharType separator) const;
450 void PrintTo(const FilePath& path, std::ostream* out);
454 // Macros for string literal initialization of FilePath::CharType[], and for
455 // using a FilePath::CharType[] in a printf-style format string.
464 // Provide a hash function so that hash_sets and maps can contain FilePath
469 struct hash<base::FilePath> {
470 size_t operator()(const base::FilePath& f) const {
471 return hash<base::FilePath::StringType>()(f.value());