diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-11-01 08:56:12 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-11-01 08:56:12 +0200 |
commit | 5e55c6c611977e2d948b5b0776e8df710e7da9c5 (patch) | |
tree | 1181ecaaf97560e8148254f1e664d6518cc3185d /thirdparty/icu4c/common/lsr.cpp | |
parent | 6afd320984cf14198368cc6c53752813a02169e3 (diff) | |
download | redot-engine-5e55c6c611977e2d948b5b0776e8df710e7da9c5.tar.gz |
ICU4C: Update to version 74.1
Diffstat (limited to 'thirdparty/icu4c/common/lsr.cpp')
-rw-r--r-- | thirdparty/icu4c/common/lsr.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/thirdparty/icu4c/common/lsr.cpp b/thirdparty/icu4c/common/lsr.cpp index 39eb46df27..bd231ecdb5 100644 --- a/thirdparty/icu4c/common/lsr.cpp +++ b/thirdparty/icu4c/common/lsr.cpp @@ -31,6 +31,26 @@ LSR::LSR(char prefix, const char *lang, const char *scr, const char *r, int32_t } } +LSR::LSR(StringPiece lang, StringPiece scr, StringPiece r, int32_t f, + UErrorCode &errorCode) : + language(nullptr), script(nullptr), region(nullptr), + regionIndex(indexForRegion(r.data())), flags(f) { + if (U_SUCCESS(errorCode)) { + CharString data; + data.append(lang, errorCode).append('\0', errorCode); + int32_t scriptOffset = data.length(); + data.append(scr, errorCode).append('\0', errorCode); + int32_t regionOffset = data.length(); + data.append(r, errorCode); + owned = data.cloneData(errorCode); + if (U_SUCCESS(errorCode)) { + language = owned; + script = owned + scriptOffset; + region = owned + regionOffset; + } + } +} + LSR::LSR(LSR &&other) noexcept : language(other.language), script(other.script), region(other.region), owned(other.owned), regionIndex(other.regionIndex), flags(other.flags), |