diff options
author | Sergey Uzhakov <uzhastik@gmail.com> | 2022-06-22 21:23:19 +0300 |
---|---|---|
committer | Sergey Uzhakov <uzhastik@gmail.com> | 2022-06-22 21:23:19 +0300 |
commit | b86c509aaa5b19d5659a4548395a47c9e87826e9 (patch) | |
tree | 98025d7bd574b788f6679b24f91711ea86bf07ae /contrib/libs/icu/common/resbund_cnv.cpp | |
parent | f55ada30d924b55d15fad9001944df1323a9598a (diff) | |
download | ydb-b86c509aaa5b19d5659a4548395a47c9e87826e9.tar.gz |
YQ-1154: allow pg translator in OSS
ref:bc7b8dcc7b45e5f527a87a1bed622dff6f06d41a
Diffstat (limited to 'contrib/libs/icu/common/resbund_cnv.cpp')
-rw-r--r-- | contrib/libs/icu/common/resbund_cnv.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/contrib/libs/icu/common/resbund_cnv.cpp b/contrib/libs/icu/common/resbund_cnv.cpp new file mode 100644 index 0000000000..45c0b399bf --- /dev/null +++ b/contrib/libs/icu/common/resbund_cnv.cpp @@ -0,0 +1,57 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* +* Copyright (C) 1997-2006, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: resbund_cnv.cpp +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2004aug25 +* created by: Markus W. Scherer +* +* Character conversion functions moved here from resbund.cpp +*/ + +#include "unicode/utypes.h" +#include "unicode/resbund.h" +#include "uinvchar.h" + +U_NAMESPACE_BEGIN + +ResourceBundle::ResourceBundle( const UnicodeString& path, + const Locale& locale, + UErrorCode& error) + :UObject(), fLocale(NULL) +{ + constructForLocale(path, locale, error); +} + +ResourceBundle::ResourceBundle( const UnicodeString& path, + UErrorCode& error) + :UObject(), fLocale(NULL) +{ + constructForLocale(path, Locale::getDefault(), error); +} + +void +ResourceBundle::constructForLocale(const UnicodeString& path, + const Locale& locale, + UErrorCode& error) +{ + if (path.isEmpty()) { + fResource = ures_open(NULL, locale.getName(), &error); + } + else { + UnicodeString nullTerminatedPath(path); + nullTerminatedPath.append((UChar)0); + fResource = ures_openU(nullTerminatedPath.getBuffer(), locale.getName(), &error); + } +} + +U_NAMESPACE_END |