Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: base/files/file_path.h

Issue 263553011: Render comment for FilePath::ReferencesParent() more precisely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // FilePath is a container for pathnames stored in a platform's native string 5 // FilePath is a container for pathnames stored in a platform's native string
6 // type, providing containers for manipulation in according with the 6 // type, providing containers for manipulation in according with the
7 // platform's conventions for pathnames. It supports the following path 7 // platform's conventions for pathnames. It supports the following path
8 // types: 8 // types:
9 // 9 //
10 // POSIX Windows 10 // POSIX Windows
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 bool EndsWithSeparator() const WARN_UNUSED_RESULT; 314 bool EndsWithSeparator() const WARN_UNUSED_RESULT;
315 315
316 // Returns a copy of this FilePath that ends with a trailing separator. If 316 // Returns a copy of this FilePath that ends with a trailing separator. If
317 // the input path is empty, an empty FilePath will be returned. 317 // the input path is empty, an empty FilePath will be returned.
318 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT; 318 FilePath AsEndingWithSeparator() const WARN_UNUSED_RESULT;
319 319
320 // Returns a copy of this FilePath that does not end with a trailing 320 // Returns a copy of this FilePath that does not end with a trailing
321 // separator. 321 // separator.
322 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT; 322 FilePath StripTrailingSeparators() const WARN_UNUSED_RESULT;
323 323
324 // Returns true if this FilePath contains any attempt to reference a parent 324 // Returns true if this FilePath contains an attempt to reference a parent
325 // directory (i.e. has a path component that is ".." 325 // directory (e.g. has a path component that is "..").
326 bool ReferencesParent() const; 326 bool ReferencesParent() const;
327 327
328 // Return a Unicode human-readable version of this path. 328 // Return a Unicode human-readable version of this path.
329 // Warning: you can *not*, in general, go from a display name back to a real 329 // Warning: you can *not*, in general, go from a display name back to a real
330 // path. Only use this when displaying paths to users, not just when you 330 // path. Only use this when displaying paths to users, not just when you
331 // want to stuff a string16 into some other API. 331 // want to stuff a string16 into some other API.
332 string16 LossyDisplayName() const; 332 string16 LossyDisplayName() const;
333 333
334 // Return the path as ASCII, or the empty string if the path is not ASCII. 334 // Return the path as ASCII, or the empty string if the path is not ASCII.
335 // This should only be used for cases where the FilePath is representing a 335 // This should only be used for cases where the FilePath is representing a
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 466
467 inline size_t hash_value(const base::FilePath& f) { 467 inline size_t hash_value(const base::FilePath& f) {
468 return hash_value(f.value()); 468 return hash_value(f.value());
469 } 469 }
470 470
471 #endif // COMPILER 471 #endif // COMPILER
472 472
473 } // namespace BASE_HASH_NAMESPACE 473 } // namespace BASE_HASH_NAMESPACE
474 474
475 #endif // BASE_FILES_FILE_PATH_H_ 475 #endif // BASE_FILES_FILE_PATH_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698