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

Side by Side Diff: icu46/source/i18n/csmatch.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years 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 | « icu46/source/i18n/csmatch.h ('k') | icu46/source/i18n/csr2022.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 **********************************************************************
3 * Copyright (C) 2005-2006, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 */
7
8 #include "unicode/utypes.h"
9
10 #if !UCONFIG_NO_CONVERSION
11 #include "unicode/unistr.h"
12 #include "unicode/ucnv.h"
13
14 #include "csmatch.h"
15
16 #include "csrecog.h"
17 #include "inputext.h"
18
19 U_NAMESPACE_BEGIN
20
21 CharsetMatch::CharsetMatch()
22 : csr(0), confidence(0)
23 {
24 // nothing else to do.
25 }
26
27 void CharsetMatch::set(InputText *input, CharsetRecognizer *cr, int32_t conf)
28 {
29 textIn = input;
30 csr = cr;
31 confidence = conf;
32 }
33
34 const char* CharsetMatch::getName()const
35 {
36 return csr->getName();
37 }
38
39 const char* CharsetMatch::getLanguage()const
40 {
41 return csr->getLanguage();
42 }
43
44 int32_t CharsetMatch::getConfidence()const
45 {
46 return confidence;
47 }
48
49 int32_t CharsetMatch::getUChars(UChar *buf, int32_t cap, UErrorCode *status) con st
50 {
51 UConverter *conv = ucnv_open(getName(), status);
52 int32_t result = ucnv_toUChars(conv, buf, cap, (const char *) textIn->fRawIn put, textIn->fRawLength, status);
53
54 ucnv_close(conv);
55
56 return result;
57 }
58
59 U_NAMESPACE_END
60
61 #endif
OLDNEW
« no previous file with comments | « icu46/source/i18n/csmatch.h ('k') | icu46/source/i18n/csr2022.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698