| OLD | NEW |
| 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 // 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/i18n/icu_string_conversions.h" | 10 #include "base/i18n/icu_string_conversions.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "base/sys_string_conversions.h" | 16 #include "base/sys_string_conversions.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "unicode/coll.h" | 18 #include "third_party/icu/public/common/unicode/uniset.h" |
| 19 #include "unicode/uniset.h" | 19 #include "third_party/icu/public/i18n/unicode/coll.h" |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 class IllegalCharacters { | 23 class IllegalCharacters { |
| 24 public: | 24 public: |
| 25 static IllegalCharacters* GetInstance() { | 25 static IllegalCharacters* GetInstance() { |
| 26 return Singleton<IllegalCharacters>::get(); | 26 return Singleton<IllegalCharacters>::get(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 bool contains(UChar32 ucs4) { | 29 bool contains(UChar32 ucs4) { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 std::string normalized_str; | 205 std::string normalized_str; |
| 206 if (base::ConvertToUtf8AndNormalize(file_name->BaseName().value(), | 206 if (base::ConvertToUtf8AndNormalize(file_name->BaseName().value(), |
| 207 base::kCodepageUTF8, | 207 base::kCodepageUTF8, |
| 208 &normalized_str)) { | 208 &normalized_str)) { |
| 209 *file_name = file_name->DirName().Append(FilePath(normalized_str)); | 209 *file_name = file_name->DirName().Append(FilePath(normalized_str)); |
| 210 } | 210 } |
| 211 #endif | 211 #endif |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace | 214 } // namespace |
| OLD | NEW |