summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/util/path_helpers_win.cc
diff options
context:
space:
mode:
authormunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 19:40:59 +0000
committermunjal@chromium.org <munjal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 19:40:59 +0000
commit6d201be0c55eccdc015124e221d2559a6da7fef0 (patch)
tree121e988c25e62017a08bcbe908a4e6a5f78d34f8 /chrome/browser/sync/util/path_helpers_win.cc
parentdc9711fe5e00639471fd0edf195a4ada4f7d994d (diff)
downloadchromium_src-6d201be0c55eccdc015124e221d2559a6da7fef0.zip
chromium_src-6d201be0c55eccdc015124e221d2559a6da7fef0.tar.gz
chromium_src-6d201be0c55eccdc015124e221d2559a6da7fef0.tar.bz2
Part 1 of removing PathSTring. I scrubbed files that are not
in chron's CL to avoid merge. Review URL: http://codereview.chromium.org/393011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31930 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/util/path_helpers_win.cc')
-rw-r--r--chrome/browser/sync/util/path_helpers_win.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/sync/util/path_helpers_win.cc b/chrome/browser/sync/util/path_helpers_win.cc
index 8fe60df..94bfb84 100644
--- a/chrome/browser/sync/util/path_helpers_win.cc
+++ b/chrome/browser/sync/util/path_helpers_win.cc
@@ -19,7 +19,7 @@
using std::string;
namespace {
-const PathString kWindowsIllegalBaseFilenames[] = {
+const string kWindowsIllegalBaseFilenames[] = {
"CON", "PRN", "AUX", "NUL", "COM1", "COM2",
"COM3", "COM4", "COM5", "COM6", "COM7",
"COM8", "COM9", "LPT1", "LPT2", "LPT3",
@@ -31,14 +31,14 @@ const PathString kWindowsIllegalBaseFilenames[] = {
// en-us/fileio/fs/naming_a_file.asp
// note that * and ? are not listed on the page as illegal characters,
// but they are.
-PathString MakePathComponentOSLegal(const PathString& component) {
+string MakePathComponentOSLegal(const string& component) {
CHECK(!component.empty());
- PathString mutable_component = component;
+ string mutable_component = component;
// Remove illegal characters.
- for (PathString::iterator i = mutable_component.begin();
+ for (string::iterator i = mutable_component.begin();
i != mutable_component.end();) {
- if ((PathString::npos != PathString("<>:\"/\\|*?").find(*i)) ||
+ if ((string::npos != string("<>:\"/\\|*?").find(*i)) ||
((static_cast<unsigned short>(*i) >= 0) &&
(static_cast<unsigned short>(*i) <= 31))) {
mutable_component.erase(i);
@@ -61,11 +61,11 @@ PathString MakePathComponentOSLegal(const PathString& component) {
// From this point out, we break mutable_component into two strings, and use
// them this way: we save anything after and including the first dot (usually
// the extension) and only mess with stuff before the first dot.
- PathString::size_type first_dot = mutable_component.find_first_of('.');
- if (PathString::npos == first_dot)
+ string::size_type first_dot = mutable_component.find_first_of('.');
+ if (string::npos == first_dot)
first_dot = mutable_component.size();
- PathString sub = mutable_component.substr(0, first_dot);
- PathString postsub = mutable_component.substr(first_dot);
+ string sub = mutable_component.substr(0, first_dot);
+ string postsub = mutable_component.substr(first_dot);
CHECK(sub + postsub == mutable_component);
for (int i = 0; i < ARRAYSIZE(kWindowsIllegalBaseFilenames); i++) {
// ComparePathNames(a, b) == 0 -> same