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

Unified Diff: chrome/browser/sync/util/path_helpers.h

Issue 340055: String cleanup in sync code (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/util/compat_file_win.cc ('k') | chrome/browser/sync/util/path_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/util/path_helpers.h
===================================================================
--- chrome/browser/sync/util/path_helpers.h (revision 30948)
+++ chrome/browser/sync/util/path_helpers.h (working copy)
@@ -9,9 +9,11 @@
#include <iterator>
#include <string>
-#include "chrome/browser/sync/util/compat_file.h"
+#include "base/file_path.h"
#include "chrome/browser/sync/util/sync_types.h"
+extern const char kPathSeparator[];
+
template <typename StringType>
class PathSegmentIterator : public std::iterator<std::forward_iterator_tag,
StringType> {
@@ -66,32 +68,6 @@
StringType value_;
};
-// NOTE: The functions (Strip)LastPathSegment always return values without a
-// trailing slash.
-PathString LastPathSegment(const PathString& path);
-std::string LastPathSegment(const std::string& path);
-PathString AppendSlash(const PathString& path);
-PathString GetFullPath(const PathString& path);
-PathString ExpandTilde(const PathString& path);
-
-inline bool HasSuffixPathString(const PathString& str,
- const PathString& suffix) {
- return str.find(suffix, str.size() - suffix.size()) != PathString::npos;
-}
-
-inline PathString StripSuffixPathString(const PathString& str,
- const PathString& suffix) {
- PathString ret(str);
- if (HasSuffixPathString(str, suffix)) {
- ret.resize(str.size() - suffix.size());
- }
- return ret;
-}
-
-// Returns a string with length or fewer elements, careful to not truncate a
-// string mid-surrogate pair.
-PathString TruncatePathString(const PathString& original, int length);
-
// Makes a path component legal for your OS, but doesn't handle collisions
// with other files in the same directory. it can do this by removing
// illegal characters and adding ~1 before the first '.' in the filename.
« no previous file with comments | « chrome/browser/sync/util/compat_file_win.cc ('k') | chrome/browser/sync/util/path_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698