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

Side by Side Diff: base/i18n/file_util_icu.cc

Issue 552026: Revert 36459 - Breaks 7 WebKit tests... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/string_util.h » ('j') | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // File utilities that use the ICU library go in this file. 5 // File utilities that use the ICU library go in this file.
6 6
7 #include "base/i18n/file_util_icu.h" 7 #include "base/i18n/file_util_icu.h"
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 set.reset(new icu::UnicodeSet(icu::UnicodeString( 55 set.reset(new icu::UnicodeSet(icu::UnicodeString(
56 L"[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\u200c\u200d]]"), status)); 56 L"[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\u200c\u200d]]"), status));
57 #else 57 #else
58 set.reset(new icu::UnicodeSet(UNICODE_STRING_SIMPLE( 58 set.reset(new icu::UnicodeSet(UNICODE_STRING_SIMPLE(
59 "[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\\u200c\\u200d]]").unescape(), 59 "[[\"*/:<>?\\\\|][:Cc:][:Cf:] - [\\u200c\\u200d]]").unescape(),
60 status)); 60 status));
61 #endif 61 #endif
62 DCHECK(U_SUCCESS(status)); 62 DCHECK(U_SUCCESS(status));
63 // Add non-characters. If this becomes a performance bottleneck by 63 // Add non-characters. If this becomes a performance bottleneck by
64 // any chance, do not add these to |set| and change IsFilenameLegal() 64 // any chance, do not add these to |set| and change IsFilenameLegal()
65 // to check |ucs4 & 0xFFFEu == 0xFFFEu|, in addition to calling 65 // to check |ucs4 & 0xFFFEu == 0xFFFEu|, in addiition to calling
66 // containsNone(). 66 // containsNone().
67 set->add(0xFDD0, 0xFDEF); 67 set->add(0xFDD0, 0xFDEF);
68 set->add(0xFFFD); // Standard replacement character.
69 for (int i = 0; i <= 0x10; ++i) { 68 for (int i = 0; i <= 0x10; ++i) {
70 int plane_base = 0x10000 * i; 69 int plane_base = 0x10000 * i;
71 set->add(plane_base + 0xFFFE, plane_base + 0xFFFF); 70 set->add(plane_base + 0xFFFE, plane_base + 0xFFFF);
72 } 71 }
73 set->freeze(); 72 set->freeze();
74 } 73 }
75 74
76 class LocaleAwareComparator { 75 class LocaleAwareComparator {
77 public: 76 public:
78 LocaleAwareComparator() { 77 LocaleAwareComparator() {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // TODO(yuzo): Perhaps we should define SysNativeMBToUTF16? 181 // TODO(yuzo): Perhaps we should define SysNativeMBToUTF16?
183 return Singleton<LocaleAwareComparator>()->Compare( 182 return Singleton<LocaleAwareComparator>()->Compare(
184 WideToUTF16(base::SysNativeMBToWide(a.value().c_str())), 183 WideToUTF16(base::SysNativeMBToWide(a.value().c_str())),
185 WideToUTF16(base::SysNativeMBToWide(b.value().c_str()))) < 0; 184 WideToUTF16(base::SysNativeMBToWide(b.value().c_str()))) < 0;
186 #else 185 #else
187 #error Not implemented on your system 186 #error Not implemented on your system
188 #endif 187 #endif
189 } 188 }
190 189
191 } // namespace 190 } // namespace
OLDNEW
« no previous file with comments | « no previous file | base/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698