OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 URL_URL_CANON_ICU_H_ | 5 #ifndef URL_URL_CANON_ICU_H_ |
6 #define URL_URL_CANON_ICU_H_ | 6 #define URL_URL_CANON_ICU_H_ |
7 | 7 |
8 // ICU integration functions. | 8 // ICU integration functions. |
9 | 9 |
10 #include "url/url_canon.h" | 10 #include "url/url_canon.h" |
| 11 #include "url/url_export.h" |
11 | 12 |
12 typedef struct UConverter UConverter; | 13 typedef struct UConverter UConverter; |
13 | 14 |
14 namespace url_canon { | 15 namespace url_canon { |
15 | 16 |
16 // An implementation of CharsetConverter that implementations can use to | 17 // An implementation of CharsetConverter that implementations can use to |
17 // interface the canonicalizer with ICU's conversion routines. | 18 // interface the canonicalizer with ICU's conversion routines. |
18 class ICUCharsetConverter : public CharsetConverter { | 19 class URL_EXPORT ICUCharsetConverter : public CharsetConverter { |
19 public: | 20 public: |
20 // Constructs a converter using an already-existing ICU character set | 21 // Constructs a converter using an already-existing ICU character set |
21 // converter. This converter is NOT owned by this object; the lifetime must | 22 // converter. This converter is NOT owned by this object; the lifetime must |
22 // be managed by the creator such that it is alive as long as this is. | 23 // be managed by the creator such that it is alive as long as this is. |
23 ICUCharsetConverter(UConverter* converter); | 24 ICUCharsetConverter(UConverter* converter); |
24 | 25 |
25 virtual ~ICUCharsetConverter(); | 26 virtual ~ICUCharsetConverter(); |
26 | 27 |
27 virtual void ConvertFromUTF16(const char16* input, | 28 virtual void ConvertFromUTF16(const char16* input, |
28 int input_len, | 29 int input_len, |
29 CanonOutput* output); | 30 CanonOutput* output); |
30 | 31 |
31 private: | 32 private: |
32 // The ICU converter, not owned by this class. | 33 // The ICU converter, not owned by this class. |
33 UConverter* converter_; | 34 UConverter* converter_; |
34 }; | 35 }; |
35 | 36 |
36 } // namespace url_canon | 37 } // namespace url_canon |
37 | 38 |
38 #endif // URL_URL_CANON_ICU_H_ | 39 #endif // URL_URL_CANON_ICU_H_ |
OLD | NEW |