Home | History | Annotate | Download | only in base

Lines Matching defs:FilePath

5 // FilePath is a container for pathnames stored in a platform's native string
25 // FilePath objects are intended to be used anywhere paths are. An
26 // application may pass FilePath objects around internally, masking the
29 // OpenFile(const FilePath &) function may be made available, allowing all
38 // Several methods are available to perform common operations on a FilePath
41 // to an existing FilePath object (Append). These methods are highly
47 // instances of FilePath objects, and are therefore safe to use on const
50 // To aid in initialization of FilePath objects from string literals, a
55 // Because a FilePath object should not be instantiated at the global scope,
56 // instead, use a FilePath::CharType[] and initialize it with
57 // FILE_PATH_LITERAL. At runtime, a FilePath object can be created from the
60 // | const FilePath::CharType kLogFileName[] = FILE_PATH_LITERAL("log.txt");
63 // | FilePath log_file_path(kLogFileName);
79 // with two leading slashes, but FilePath handles this case properly
80 // in case it ever comes across such a system. FilePath needs this support
91 // equivalent. Since the OS treats these paths specially, FilePath needs
93 // FilePath treats c://, c:\\, //, and \\ all equivalently.
127 class BASE_API FilePath {
157 FilePath();
158 FilePath(const FilePath& that);
159 explicit FilePath(const StringType& path);
160 ~FilePath();
161 FilePath& operator=(const FilePath& that);
163 bool operator==(const FilePath& that) const;
165 bool operator!=(const FilePath& that) const;
168 bool operator<(const FilePath& that) const {
184 void GetComponents(std::vector<FilePath::StringType>* components) const;
186 // Returns true if this FilePath is a strict parent of the |child|. Absolute
191 bool IsParent(const FilePath& child) const;
201 bool AppendRelativePath(const FilePath& child, FilePath* path) const;
203 // Returns a FilePath corresponding to the directory containing the path
205 // only contains one component, returns a FilePath identifying
207 // returns a FilePath identifying the root directory.
208 FilePath DirName() const;
210 // Returns a FilePath corresponding to the last path component of this
212 // the root directory, returns a FilePath identifying the root directory;
214 FilePath BaseName() const;
229 FilePath RemoveExtension() const;
238 FilePath InsertBeforeExtension(const StringType& suffix) const;
239 FilePath InsertBeforeExtensionASCII(const base::StringPiece& suffix) const;
245 FilePath ReplaceExtension(const StringType& extension) const;
251 // Returns a FilePath by appending a separator and the supplied path
254 // If this object's path is kCurrentDirectory, a new FilePath corresponding
257 FilePath Append(const StringType& component) const WARN_UNUSED_RESULT;
258 FilePath Append(const FilePath& component) const WARN_UNUSED_RESULT;
266 FilePath AppendASCII(const base::StringPiece& component)
269 // Returns true if this FilePath contains an absolute path. On Windows, an
275 // Returns a copy of this FilePath that does not end with a trailing
277 FilePath StripTrailingSeparators() const;
279 // Returns true if this FilePath contains any attempt to reference a parent
290 // This should only be used for cases where the FilePath is representing a
296 // useful to smooth porting that old code to the FilePath API.
302 // try to convert the API into using FilePath.
310 static FilePath FromWStringHack(const std::wstring& wstring);
314 const FilePath::StringType& path);
316 FilePath::StringType* path);
323 FilePath NormalizeWindowsPathSeparators() const;
351 static StringType GetHFSDecomposedForm(const FilePath::StringType& string);
372 // Macros for string literal initialization of FilePath::CharType[], and for
373 // using a FilePath::CharType[] in a printf-style format string.
384 // Provide a hash function so that hash_sets and maps can contain FilePath
390 struct hash<FilePath> {
391 size_t operator()(const FilePath& f) const {
392 return hash<FilePath::StringType>()(f.value());
400 inline size_t hash_value(const FilePath& f) {