From 6d201be0c55eccdc015124e221d2559a6da7fef0 Mon Sep 17 00:00:00 2001 From: "munjal@chromium.org" Date: Fri, 13 Nov 2009 19:40:59 +0000 Subject: 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 --- chrome/browser/sync/util/path_helpers_win.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'chrome/browser/sync/util/path_helpers_win.cc') 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(*i) >= 0) && (static_cast(*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 -- cgit v1.1