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

Side by Side Diff: ui/base/l10n/l10n_util_collator.h

Issue 7569005: Rename UI_API to UI_EXPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « ui/base/l10n/l10n_util.h ('k') | ui/base/l10n/l10n_util_mac.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_BASE_L10N_L10N_UTIL_COLLATOR_H_ 5 #ifndef UI_BASE_L10N_L10N_UTIL_COLLATOR_H_
6 #define UI_BASE_L10N_L10N_UTIL_COLLATOR_H_ 6 #define UI_BASE_L10N_L10N_UTIL_COLLATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <functional> 10 #include <functional>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/utf_string_conversions.h" 15 #include "base/utf_string_conversions.h"
16 #include "ui/ui_api.h" 16 #include "ui/base/ui_export.h"
17 #include "unicode/coll.h" 17 #include "unicode/coll.h"
18 18
19 namespace l10n_util { 19 namespace l10n_util {
20 20
21 // Compares the two strings using the specified collator. 21 // Compares the two strings using the specified collator.
22 UI_API UCollationResult CompareString16WithCollator( 22 UI_EXPORT UCollationResult CompareString16WithCollator(
23 const icu::Collator* collator, 23 const icu::Collator* collator,
24 const string16& lhs, 24 const string16& lhs,
25 const string16& rhs); 25 const string16& rhs);
26 26
27 // Used by SortStringsUsingMethod. Invokes a method on the objects passed to 27 // Used by SortStringsUsingMethod. Invokes a method on the objects passed to
28 // operator (), comparing the string results using a collator. 28 // operator (), comparing the string results using a collator.
29 template <class T, class Method> 29 template <class T, class Method>
30 class StringMethodComparatorWithCollator 30 class StringMethodComparatorWithCollator
31 : public std::binary_function<const string16&, 31 : public std::binary_function<const string16&,
32 const string16&, 32 const string16&,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 return StringComparator<string16>(collator_)(lhs_string_key, 106 return StringComparator<string16>(collator_)(lhs_string_key,
107 rhs_string_key); 107 rhs_string_key);
108 } 108 }
109 109
110 private: 110 private:
111 icu::Collator* collator_; 111 icu::Collator* collator_;
112 }; 112 };
113 113
114 // Specialization of operator() method for string16 version. 114 // Specialization of operator() method for string16 version.
115 template <> UI_API 115 template <> UI_EXPORT
116 bool StringComparator<string16>::operator()(const string16& lhs, 116 bool StringComparator<string16>::operator()(const string16& lhs,
117 const string16& rhs); 117 const string16& rhs);
118 118
119 // In place sorting of |elements| of a vector according to the string key of 119 // In place sorting of |elements| of a vector according to the string key of
120 // each element in the vector by using collation rules for |locale|. 120 // each element in the vector by using collation rules for |locale|.
121 // |begin_index| points to the start position of elements in the vector which 121 // |begin_index| points to the start position of elements in the vector which
122 // want to be sorted. |end_index| points to the end position of elements in the 122 // want to be sorted. |end_index| points to the end position of elements in the
123 // vector which want to be sorted 123 // vector which want to be sorted
124 template <class Element> 124 template <class Element>
125 void SortVectorWithStringKey(const std::string& locale, 125 void SortVectorWithStringKey(const std::string& locale,
(...skipping 22 matching lines...) Expand all
148 void SortVectorWithStringKey(const std::string& locale, 148 void SortVectorWithStringKey(const std::string& locale,
149 std::vector<Element>* elements, 149 std::vector<Element>* elements,
150 bool needs_stable_sort) { 150 bool needs_stable_sort) {
151 SortVectorWithStringKey<Element>(locale, elements, 0, elements->size(), 151 SortVectorWithStringKey<Element>(locale, elements, 0, elements->size(),
152 needs_stable_sort); 152 needs_stable_sort);
153 } 153 }
154 154
155 } // namespace l10n_util 155 } // namespace l10n_util
156 156
157 #endif // UI_BASE_L10N_L10N_UTIL_COLLATOR_H_ 157 #endif // UI_BASE_L10N_L10N_UTIL_COLLATOR_H_
OLDNEW
« no previous file with comments | « ui/base/l10n/l10n_util.h ('k') | ui/base/l10n/l10n_util_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698