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

Side by Side Diff: icu46/source/common/locbased.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/common/locbased.h ('k') | icu46/source/common/locdispnames.cpp » ('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) 2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: January 16 2004
8 * Since: ICU 2.8
9 **********************************************************************
10 */
11 #include "locbased.h"
12 #include "cstring.h"
13
14 U_NAMESPACE_BEGIN
15
16 Locale LocaleBased::getLocale(ULocDataLocaleType type, UErrorCode& status) const {
17 const char* id = getLocaleID(type, status);
18 return Locale((id != 0) ? id : "");
19 }
20
21 const char* LocaleBased::getLocaleID(ULocDataLocaleType type, UErrorCode& status ) const {
22 if (U_FAILURE(status)) {
23 return NULL;
24 }
25
26 switch(type) {
27 case ULOC_VALID_LOCALE:
28 return valid;
29 case ULOC_ACTUAL_LOCALE:
30 return actual;
31 default:
32 status = U_ILLEGAL_ARGUMENT_ERROR;
33 return NULL;
34 }
35 }
36
37 void LocaleBased::setLocaleIDs(const char* validID, const char* actualID) {
38 if (validID != 0) {
39 uprv_strcpy(valid, validID);
40 }
41 if (actualID != 0) {
42 uprv_strcpy(actual, actualID);
43 }
44 }
45
46 U_NAMESPACE_END
OLDNEW
« no previous file with comments | « icu46/source/common/locbased.h ('k') | icu46/source/common/locdispnames.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698