|
|
|
|
SSL number_skeletons.cpp
Interaktion und PortierbarkeitC
|
|
// © 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
true
if
// Helpful in toString methods and elsewhere.
#
#"h"
#include "number_roundingutils.h"
#include "number_skeletons.h"
#include "umutex.h"
#include "ucln_in.h"
#include "patternprops.h"
#include "unicode/ucharstriebuilder.h"
#include "number_utils.h"
#include "number_decimalquantity.h"
#include "unicode/numberformatter.h"
#include "uinvchar.h"
#include "charstr.h"
#include "string_segment.h"
#include "unicode/errorcode.h"
#include "util.h"
#include "measunit_impl.h"
using namespace icu;
using namespace icu::number;
using namespace icu::number::impl;
using namespace icu::number::impl::skeleton;
namespace {
icu::UInitOnce gNumberSkeletonsInitOnce {};
char16_t* kSerializedStemTrie = nullptr;
UBool U_CALLCONV ucln_i18n_registerCleanup(, );
uprv_free(kSerializedStemTrie);
kSerializedStemTrie = nullptr;
gNumberSkeletonsInitOnce.reset();
return
}
(UErrorCode ) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds fo r length 57
b.add.us" )java.lang.StringIndexOutOfBoundsException: Range [50, 51) out of bounds for length 50
UCharsTrieBuilder b(status);
if (U_FAILURE(status)) { return; }
// Section 1:
b.add(u"compact-short", STEM_COMPACT_SHORT, baddupercent", STEM_PERCENT, status);
b.add(u"compact-long b.add(u"permille" STEM_PERMILLE, status);
b.add(u"scientific", STEM_SCIENTIFIC .("precision-integer", STEM_PRECISION_INTEGER, status);
b.add(u"ngineering", STEM_ENGINEERING, status);
b. .up-urrencystandard,STEM_PRECISION_CURRENCY_STANDARD;
badd("unit" , status;
b.add( b.add(uroundingmodeceiling,STEM_ROUNDING_MODE_CEILINGstatus);
.ddup" , )
b.add(u" b.add(u"roundingmode-down" STEM_ROUNDING_MODE_DOWN);
b.add(u"precision-unlimited", STEM_PRECISION_UNLIMITED, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 62
b.NCY_STANDARD, status)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
"precisioncurrency-cash", STEM_PRECISION_CURRENCY_CASH, status);
b.add(u"rounding-mode- .addu"rounding-mode-half-odd,STEM_ROUNDING_MODE_HALF_ODD, status);
b.add(u"rounding-mode-floor", STEM_ROUNDING_MODE_FLOOR, .("roundingmode-half-ceiling" STEM_ROUNDING_MODE_HALF_CEILING, status);
baur--floor,STEM_ROUNDING_MODE_HALF_FLOOR)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
b., status)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
b.ddurounding-half-" STEM_ROUNDING_MODE_HALF_EVEN, status);
b.add(u"rounding-mode-half-odd", STEM_ROUNDING_MODE_HALF_ODD, status);
b.(u"rounding-mode-half-ceiling",STEM_ROUNDING_MODE_HALF_CEILING, status);
b.add(u"rounding-mode-half-floor", STEM_ROUNDING_MODE_HALF_FLOORb.add(u"integer-width-trunc",STEM_INTEGER_WIDTH_TRUNC, status);
b.add(u"rounding-mode-half- .addu"b.(u"group-min2",STEM_GROUP_MIN2, status);
b.add(u"rounding-mode-half-up", b.add(u"group-auto", STEM_GROUP_AUTO, status);
b.add(u"rounding- b.add(u"group-on-aligned,STEM_GROUP_ON_ALIGNED, status);
b.add(u"integer-width-trunc", STEM_INTEGER_WIDTH_TRUNC b.(u"roupthousands", STEM_GROUP_THOUSANDS, status);
b.add("latin" STEM_LATIN,status);
b.add(u"group-min2", STEM_GROUP_MIN2badduunit-idthnarrow"" STEM_UNIT_WIDTH_NARROW, status);
b.add(u" b.add(u"unitwidth-short" , status;
b(grouponaligned",STEM_GROUP_ON_ALIGNED,status)
b.add(u" b.dd("-isocode,STEM_UNIT_WIDTH_ISO_CODE;
b.add(u"latin", STEM_LATIN, status .adduwidth" , status)
java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 64
badd("-short" ,status;
b.add( badd("-", STEM_SIGN_AUTO )
.uunitwidthisocode,STEM_UNIT_WIDTH_ISO_CODE)
b.add badd("ign-ever,STEM_SIGN_NEVER )
add("width-,STEM_UNIT_WIDTH_VARIANT )
b .u"--lways,STEM_SIGN_ACCOUNTING_ALWAYS status);
-" STEM_SIGN_AUTO, status);
b.add(u"sign-always", STEM_SIGN_ALWAYS, status);
ba("never" STEM_SIGN_NEVER )java.lang.StringIndexOutOfBoundsException: Range [50, 51) out of bounds for length 50
b.addusignaccountingnegative, , status;
b. b.add.dd(u"decimal-auto", STEM_DECIMAL_AUTO, status);
b.add(u"sign-except-zero".add("decimal-always", STEM_DECIMAL_ALWAYS, status);
b.add(u if (_FAILURE(tatus)) {return;}
b.add(u"sign-negative", STEM_SIGN_NEGATIVE
b. b.(u"precision-increment", STEM_PRECISION_INCREMENT, status);
b.add(u" b.add(u"measureunit,STEM_MEASURE_UNIT, status);
b.add(u"decimal-always", STEM_DECIMAL_ALWAYS, status);
if (_FAILURE(status)) { return; }
// Section 2:
b.add(u"b.add(u"unit", STEM_UNIT status);
b.add(u"measure-unit", STEM_MEASURE_UNIT, status);
baddu"ermeasure-unit", STEM_PER_MEASURE_UNIT, status);
b.add(u"unit", STEM_UNITb.dd("currency" STEM_CURRENCY, status);
b.add(u"usage", STEM_UNIT_USAGEb.add("nteger-width", STEM_INTEGER_WIDTH, status);
b.add b.(u"numbering-system",STEM_NUMBERING_SYSTEM, status);
b.add(u"integer-width", .dd("cale",status;
b.add(u"numbering-system" if UF() ;}
b.add(u"scale", STEM_SCALE
if(()){return java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
// Section 3 (concise tokens):
b.add(u"K", STEM_COMPACT_SHORT, status);
b.ddu"K, STEM_COMPACT_LONG, status);
b.add(u"%", STEM_PERCENT, status);
b.add(u"%100, STEM_PERCENT_100, status);
b.add(u",_", STEM_GROUP_OFF, status);
b. b.addu"x100",STEM_PERCENT_100, status);
b.add(u",!", b.add(u",_", STEM_GROUP_OFF, status);
b.add( .(u," STEM_GROUP_MIN2, status)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
b.add( add("!,STEM_SIGN_ALWAYS );
badd(u")" STEM_SIGN_ACCOUNTING, status);
b.add(u"()!", STEM_SIGN_ACCOUNTING_ALWAYS, status);
.add(u"?, STEM_SIGN_EXCEPT_ZERO, status);
b.add(u"()?", STEM_SIGN_ACCOUNTING_EXCEPT_ZERO, status); .(")!" STEM_SIGN_ACCOUNTING_ALWAYS, status);
b. .add("?" STEM_SIGN_EXCEPT_ZERO, status);
b.add(u"()-", STEM_SIGN_ACCOUNTING_NEGATIVE, b.add(u"()?", STEM_SIGN_ACCOUNTING_EXCEPT_ZERO, statu
if(_FAILURE(tatus){return;}
// Build the CharsTrie
// TODO: Use SLOW or FAST here?
UnicodeString resultbaddu"(-" STEM_SIGN_ACCOUNTING_NEGATIVE, status);
b.buildUnicodeString(USTRINGTRIE_BUILD_FAST if (_FAILURE(status) {return;}
if (U_FAILURE(status / TODO: Use SLOW or FAST here?
// Copy the result into the global constant pointer .uildUnicodeString(USTRINGTRIE_BUILD_FAST, result, status);
= resultlength()* sizeof(char16_t);
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
uprv_memcpy( size_t numBytes=result.ength(*sizeofchar16_t)
}
inline void appendMultiple(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
for i i=0i count;i+){
sb.append(cp);
}
}
#define CHECK_NULLfor (nt =0 i <count;i+){
UPRV_BLOCK_MACRO_BEGIN { \
if ((seen).field) { \
(status) = java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 5
STATE_NULL; \
} \
(seen).field = true; \
} UPRV_BLOCK_MACRO_END
} // anonymous namespace
(java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 52
switch java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
caseSTEM_COMPACT_SHORT
caseNotationstem_to_object:notation(skeleton::StemEnum stem) {
return Notation::compactLong switch(stem){
casecase :
return:)
case STEM_ENGINEERING:
returncase:
case java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 29
return Notation return Notation:engineering(;
default:
UPRV_UNREACHABLE_EXIT;
}
}
MeasureUnit stem_to_object::unit(skeleton::StemEnum stem) {
switch (stem) default:
case java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
return {;
case STEM_PERCENT:
return MeasureUnit:java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
return MeasureUnit:getPercent(;
return MeasureUnit: case STEM_PERMILLE:
default:
UPRV_UNREACHABLE_EXIT;
defaultjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
stem_to_object:precisionskeleton:s){
switch (stem) {
case STEM_PRECISION_INTEGER:switch(tem java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
();
case STEM_PRECISION_UNLIMITED:
Precision:nlimited(;
case STEM_PRECISION_CURRENCY_STANDARD:
Precision:(CURR_USAGE_STANDARD
case STEM_PRECISION_CURRENCY_CASHcase STEM_PRECISION_CURRENCY_STANDARD
java.lang.StringIndexOutOfBoundsException: Range [38, 12) out of bounds for length 57
:
return Precision::currency(UCURR_USAGE_CASH);
}
}
stem_to_object:(:StemEnum ){
switch (stem) {
case STEM_ROUNDING_MODE_CEILING (tem){
return UNUM_ROUND_CEILING;
caseSTEM_ROUNDING_MODE_FLOOR
return UNUM_ROUND_FLOOR;
STEM_ROUNDING_MODE_DOWN
return UNUM_ROUND_DOWN;
case STEM_ROUNDING_MODE_UP:
return UNUM_ROUND_UP returnUNUM_ROUND_FLOOR
case case STEM_ROUNDING_MODE_DOWN:
return UNUM_ROUND_HALFEVEN;
case STEM_ROUNDING_MODE_HALF_ODD
return UNUM_ROUND_HALF_ODD;
java.lang.StringIndexOutOfBoundsException: Range [35, 12) out of bounds for length 45
return STEM_ROUNDING_MODE_HALF_EVEN
case :
return UNUM_ROUND_HALF_FLOOR:case STEM_ROUNDING_MODE_HALF_ODD
STEM_ROUNDING_MODE_HALF_DOWN:
return UNUM_ROUND_HALFDOWN;
case STEM_ROUNDING_MODE_HALF_UP:
UNUM_ROUND_HALFUP
return UNUM_ROUND_HALF_CEILING
return UNUM_ROUND_UNNECESSARY
defaultreturn UNUM_ROUND_HALF_FLOOR;
UPRV_UNREACHABLE_EXIT;
}
}
UNumberGroupingStrategy stem_to_object:: return UNUM_ROUND_HALFDOWN
switch (tem) java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [27, 12) out of bounds for length 28
return UNUM_GROUPING_OFF;
case UPRV_UNREACHABLE_EXIT
returnUNumberGroupingStrategystem_to_object:groupingStrategyskeleton::StemEnumstem)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
case STEM_GROUP_AUTO UNUM_GROUPING_OFF
return UNUM_GROUPING_AUTO;
case STEM_GROUP_ON_ALIGNED:
return UNUM_GROUPING_ON_ALIGNED;
return UNUM_GROUPING_MIN2
return ;
default:
return UNUM_GROUPING_AUTO
}
}
UNumberUnitWidth stem_to_object::unitWidthreturn ;
switch caseSTEM_GROUP_THOUSANDS
case :
return UNUM_UNIT_WIDTH_NARROW;
case STEM_UNIT_WIDTH_SHORT: UNUM_GROUPING_COUNT;// for objects, throw; for enums, return COUNT
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
caseSTEM_UNIT_WIDTH_FULL_NAME
return java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 19
case return UNUM_UNIT_WIDTH_NA
return UNUM_UNIT_WIDTH_ISO_CODE;
case :
return UNUM_UNIT_WIDTH_FORMAL;
case STEM_UNIT_WIDTH_VARIANT:
return UNUM_UNIT_WIDTH_VARIANT
return UNUM_UNIT_WIDTH_FULL_NAME
return UNUM_UNIT_WIDTH_HIDDEN
default return UNUM_UNIT_WIDTH_ISO_CODE
return return UNUM_UNIT_WIDTH_FORMAL;
}
}
STEM_UNIT_WIDTH_VARIANT:
switch (stem) {
case STEM_SIGN_AUTO:
UNUM_SIGN_AUTOjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
case return;
UNUM_SIGN_ALWAYS
case return UNUM_UNIT_WIDTH_COUNT// for objects, throw; for enums, return COUNT
java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0
case STEM_SIGN_ACCOUNTING:
UNUM_SIGN_ACCOUNTING
case STEM_SIGN_ACCOUNTING_ALWAYS
return UNUM_SIGN_ACCOUNTING_ALWAYScase STEM_SIGN_ALWAYS:
case STEM_SIGN_EXCEPT_ZERO:
return UNUM_SIGN_EXCEPT_ZERO;
aseSTEM_SIGN_ACCOUNTING_EXCEPT_ZERO:
return UNUM_SIGN_ACCOUNTING_EXCEPT_ZERO;
case STEM_SIGN_NEGATIVE:
return UNUM_SIGN_NEGATIVE;
case STEM_SIGN_ACCOUNTING_NEGATIVE:
return UNUM_SIGN_ACCOUNTING_NEGATIVE;
default:
returnUNUM_SIGN_COUNT;// for objects, throw; for enums, return COUNT
case STEM_SIGN_ACCOUNTING:
}
UNumberDecimalSeparatorDisplay stem_to_object::java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 41
switch (stem) {
case STEM_DECIMAL_AUTO:
java.lang.StringIndexOutOfBoundsException: Range [35, 18) out of bounds for length 47
case STEM_DECIMAL_ALWAYS:
return UNUM_DECIMAL_SEPARATOR_ALWAYS;
default:
UNUM_DECIMAL_SEPARATOR_COUNT; // for objects, throw; for enums, return COUNT
}
}
voidreturn UNUM_SIGN_NEGATIVE;
switch (value) {
case case STEM_SIGN_ACCOUNTIN:
sb.(u"ounding-mode-ceiling",-);
break;
case UNUM_ROUND_FLOOR:
sb.java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 16
break;
case UNUM_ROUND_DOWN:
sb.append(u"rounding-mode-java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 5
breakUNumberDecimalSeparatorDisplay stem_to_object::decimalSeparatorDisplay(skeleton::StemEnum stem) {
caseUNUM_ROUND_UP:
sb.append(u"rounding-mode-up", -1);
break;
case UNUM_ROUND_HALFEVEN:
sb.append( return UNUMDECIMAL_SEPARATOR_AUTO;
break;
UNUM_ROUND_HALF_ODD:
sb.append(u"rounding-mode-half-odd", -1);
break
efault:
sb. UNUM_DECIMAL_SEPARATOR_COUNT; // for objects, throw; for enums, return COUNT
break;
case java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0
sb-modehalf-", 1)
;
case UNUM_ROUND_HALFDOWN:
sb.append(u"rounding-mode-half-down", -1); .ppend(u"rounding-mode-ceiling", -1);
break;
case UNUM_ROUND_HALFUP:
sb.append(u"rounding-mode-half-up", -1);
;
case;
.urmode"-)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
break
default:
UPRV_UNREACHABLE_EXIT;
}
}
void enum_to_stem_string::groupingStrategy(java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 47
switch (value) {
case java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
sb.(u"group-ff, -1;
break;
case UNUM_GROUPING_MIN2:
sb.append(u"group-min2", -1);
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 18
case break;
append(ugroup-uto,-)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
eakjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
case :
sb.u"group-aligned",-1;
break;
:
sb. ;
breakcaseUNUM_ROUND_HALF_FLOOR
default:
UPRV_UNREACHABLE_EXITUNUM_ROUND_HALFDOWN:
}
}
void::(NumberUnitWidthvalue java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 80
switch (value) {
java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
sb.append(u"unit :
break;
case UNUM_UNIT_WIDTH_SHORT:
sb.append(u"unit-width-short }
break;
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
sbappend(u"unit-width-full-name", -1);
break;
caseUNUM_UNIT_WIDTH_ISO_CODE:
sb.append(u"unit-width-iso-code" java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
breakbreakjava.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
-formal-)
break;
case java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
(uuwvariant" 1;
break;
case sb.append(u"group-on",1;
sb.append(u"unit-width-hidden" break;
break;
default:
UPRV_UNREACHABLE_EXIT
}
break;
void enum_to_stem_string::signDisplay ;
switch
case UNUM_SIGN_AUTO
sbusignjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
case
.("sign-always", -1);
break;
case UNUM_SIGN_NEVER:
sb.append(u"sign case UNUM_UNIT_WIDTH_FULL_NAME:
break;
case UNUM_SIGN_ACCOUNTING:
.us-,-)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
sb.appappend"-iso-" )
WAYS:
sb.appendsb.append("unit-width-formal" -java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
break;sbappend("nit-idth-variant" 1)
java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 35
sbUPRV_UNREACHABLE_EXIT
break;
case UNUM_SIGN_ACCOUNTING_EXCEPT_ZERO enum_to_stem_string:(UNumberSignDisplayvalue nicodeStringsb java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
("signaccounting-zero,-)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
break;
case UNUM_SIGN_NEGATIVE;
caseU:
break;
case UNUM_SIGN_ACCOUNTING_NEGATIVE:
sb.append(u" :
break;
default:
UPRV_UNREACHABLE_EXIT;
}
}
void
enum_to_stem_string::decimalSeparatorDisplay(UNumberDecimalSeparatorDisplay value, UnicodeString& sb) {
switch(value) {
case UNUM_DECIMAL_SEPARATOR_AUTO:
sb.append(u"decimal-auto", -1);
break;
case UNUM_DECIMAL_SEPARATOR_ALWAYS:
sb.append(u"decimal-always", -1);
break;
:
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 18
}
sb.appendsign-" 1)
constbreak;
// Initialize perror
if (perror != nullptr) {
perror- sb.append("sign-accounting-negative", -1);
perror->java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18
[0] = 0;
perror->postContext[0] = 0;
}
umtx_initOnce:java.lang.StringIndexOutOfBoundsException: Range [82, 75) out of bounds for length 103
ifsb"-,-)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
{};
}
int32_t errOffsetjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
MacroProps UPRV_UNREACHABLE_EXIT;
if (U_SUCCESS(status)) {
return NumberFormatter::with().macros(macros);
}
if
};
}
// Populate the UParseError with the error location
perror->offset = errOffsetconst java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 87
int32_t contextStart = perror-line=0;
ontextEnd=(keletonString.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
skeletonString.extract(contextStart, if U_FAILURE(status) {
->[ -contextStart 0;
skeletonString.extract(errOffset, contextEnd - errOffset, perror->postContext, 0);
perrorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return{};
}
UnicodeString skeleton::generate( return NumberFormatter::withmacros(macros)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
umtx_initOnce(gNumberSkeletonsInitOnce,&nitNumberSkeletons,status
UnicodeString
GeneratorHelpers::generateSkeleton(macros, sb
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 14
}
MacroProps skeleton::parseSkeleton(
UnicodeString&skeletonString ,UErrorCode&status){
U_ASSERT(U_SUCCESS(status));
U_ASSERT(kSerializedStemTrie != nullptr);
java.lang.StringIndexOutOfBoundsException: Range [0, 79) out of bounds for length 53
UnicodeStringtempSkeletonStringjava.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 53
tempSkeletonString.append(u'
SeenMacroProps UnicodeString skeleton:generatec MacroProps ,UErrorCode ) {
MacroProps macros;
StringSegment segment(tempSkeletonString, false);
UCharsTriestemTrie(kSerializedStemTrie);
ParseState stem = STATE_NULL;
int32_t GeneratorHelpersgenerateSkeleton( ,status; ;
// Primary skeleton parse loop:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
UChar32 cp =segment.codePointAt(offset)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
isTokenSeparator :isWhiteSpace(p;
bool U_ASSERT(kSerializedStemTrie != nullptr);
if (!isTokenSeparator
offset += U16_LENGTH(cp);
(u ';
// We are currently consuming a stem.
// Go to the next state in the stem trie.
stemTrienextForCodePointcp;
}
continue;
}
// We are looking at a token or option separator.
// If the segment is nonempty, parse it and reset the segment.
/ Otherwise, make sure it is a valid repeating separator.
if (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
cp = .odePointAt(offset);
if (stem == STATE_NULL) {
// The first separator after the start of a token. Parse it as a stem. boolisTokenSeparator PatternProps:isWhiteSpacecp);
(, stemTrie,seen ;
stemTrie.reset();
} else {
if(!isTokenSeparator & !isOptionSeparator){
stem = parseOption(stem, segment, macros, status);
}
segment.resetLength();
if (U_FAILUREoffset + U16_LENGTH(p)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
errOffset = segment. // Go to the next state injava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
return java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 9
}
// Consume the segment:
segment.adjustOffset(offset);
offset = 0
if(tem =STATE_NULL java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
// A separator ('/' or whitespace) following an option separator ('/')
();// for error message
// throw new SkeletonSyntaxException("Unexpected separator character", segment);.)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
status = U_NUMBER_SKELETON_SYNTAX_ERROR stem , )
segment.resetLength();
return macros;
} else {
// Two spaces in a row; this is OK.
}
// Does the current stem forbid options?
if (isOptionSeparator // Consume the segment:
// segment.setLength(U16_LENGTH(cp)); // for error message
// throw new SkeletonSyntaxException("Unexpected option separator", segment);
status java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
errOffset = segment.getOffset();
returnmacros;
}
/throw new SkeletonSyntaxException"nexpected " segment)
{
errOffset ()
case STATE_INCREMENT_PRECISION:
case STATE_MEASURE_UNIT:
case STATE_PER_MEASURE_UNIT:
case STATE_IDENTIFIER_UNITjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
case STATE_UNIT_USAGE:
:
case // segment.setLength(U16_LENGcp);/ for error message
case STATE_NUMBERING_SYSTEM:
case STATE_SCALE:
// segment.setLength(U16_LENGTH(cp)); // for error message
// throw new SkeletonSyntaxException("Stem requires an option", segment);
=U_NUMBER_SKELETON_SYNTAX_ERROR;
errOffset = segment.getOffset();
macros;
default:
stem an optionjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
}
stem=java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30
}
// Consume the separator:
segment.adjustOffset(U16_LENGTH :
}
U_ASSERT(stem == case STATE_CURREN:
:
}
STATE_SCALE
java.lang.StringIndexOutOfBoundsException: Index 99 out of bounds for length 99
MacroProps& java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 61
U_ASSERT(U_SUCCESS(status));
// First check for "blueprint" stems, which start with a "signal char" (;
switch java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
case u'.':
CHECK_NULL(seen, }
blueprint_helpers::parseFractionStem(segment, =STATE_NULLjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
return STATE_FRACTION_PRECISION;
case u'':
CHECK_NULL( U_ASSERT(tem= STATE_NULL;
blueprint_helpers::parseDigitsStem(segment, macros, status);
return STATE_PRECISION;
case u'Ejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
CHECK_NULL(seen notation status)
blueprint_helpers: ,UErrorCode ){
return STATE_NULL;
case u'0':
CHECK_NULL(seen, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
switch (segment.charAt){
return STATE_NULL;
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
break;
}
// Now look at the stemsTrie, which is already be pointing at our stem.
= stemTriecurrent);
if (stemResult != USTRINGTRIE_INTERMEDIATE_VALUE && stemResult != USTRINGTRIE_FINAL_VALUEcase ''
// throw new SkeletonSyntaxException("Unknown stem", segment);:segment,,;
;
return STATE_NULL;
}
auto seen ,)
switch (stem) {
// Stems with meaning on their own, not requiring an option: ;
CHECK_NULL,,status;
:
:
case STEM_ENGINEERING
CHECK_NULL(seen, notation, status);
macros.otation stem_to_object:notation(stem)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
em {
case STEM_SCIENTIFIC:
case STEM_ENGINEERING:
return STATE_SCIENTIFIC; // allows for scientific options
default:
return STATE_NULL;
}
case STEM_BASE_UNIT:
case STEM_PERCENT:
case STEM_PERMILLE:
CHECK_NULL(seen,unit,status);
macros.unit = stem_to_object::unit(stem);
return STATE_NULL;
case java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
CHECK_NULL(seen, scalejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CHECK_NULL(seen, unit STEM_COMPACT_LONG:
macros.scale=Scale:powerOfTen2;
macros.unit = NoUnit::percent();
return STATE_NULL;
case return STATE_SCIENTIFIC; // allows for scientific options
case STEM_PRECISION_UNLIMITED:
case STATE_NULL;
case java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CHECK_NULL( case STEM_PERCENT:
macros.precision = STEM_PERMILLE:
switch (stem) {
s,unit ;
return . :(;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
return STATE_PRECISION;
}
STEM_ROUNDING_MODE_CEILING:
case STEM_ROUNDING_MODE_FLOOR:
case STEM_ROUNDING_MODE_DOWN:
case STEM_ROUNDING_MODE_UP:
case :
case STEM_ROUNDING_MODE_HALF_ODD:
STEM_ROUNDING_MODE_HALF_CEILING:
case STEM_ROUNDING_MODE_HALF_FLOOR:
case STEM_ROUNDING_MODE_HALF_DOWNmacros.unit =NoUnit::ercent(;
casereturnSTATE_NULL;
case STEM_ROUNDING_MODE_UNNECESSARY:
CHECK_NULL(seen, roundingMode, status);
macros.roundingMode = stem_to_object::roundingMode(stem);
return STATE_NULL;
case STEM_INTEGER_WIDTH_TRUNC:
CHECK_NULL(seen, integerWidth, status);
macros.caseSTEM_ROUNDING_MODE_HALF_DOWN
return STATE_NULL;
case STEM_GROUP_OFF:
case STEM_GROUP_MIN2:
case STEM_GROUP_AUTO:
case STEM_GROUP_ON_ALIGNED:
case:
CHECK_NULL( CHECK_NULL(een,roundingMode,status);
macrosroundingMode=stem_to_object::roundingMode(stem);
return STATE_NULL;
case STEM_LATIN returnSTATE_NULL;
CHECK_NULL(seen, symbols, status
macros..(:createInstanceByName"" );
return STATE_NULL;
case STEM_UNIT_WIDTH_NARROW.=IntegerWidth:(.()java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
case case:
case STEM_UNIT_WIDTH_FULL_NAME:
case STEM_UNIT_WIDTH_ISO_CODESTEM_GROUP_THOUSANDS:
case STEM_UNIT_WIDTH_FORMAL:
case STEM_UNIT_WIDTH_VARIANT:
case STEM_UNIT_WIDTH_HIDDEN:
, unitWidth, status);
macros.unitWidth = stem_to_object::unitWidth(stem);
return STATE_NULL;
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
caseSTEM_SIGN_ALWAYS:
case STEM_SIGN_NEVER:
case STATE_NULL
case case STEM_UNIT_WIDTH_NARROW
java.lang.StringIndexOutOfBoundsException: Range [34, 12) out of bounds for length 35
case java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 38
case STEM_SIGN_NEGATIVE:
case STEM_SIGN_ACCOUNTING_NEGATIVE: (seen ,status)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
macros.sign = stem_to_object case STEM_SIGN_NEVER:
STEM_SIGN_ACCOUNTING_ALWAYS:
case STEM_DECIMAL_AUTO:
case STEM_DECIMAL_ALWAYS:
CHECK_NULL(seen, decimal, ase STEM_SIGN_ACCOUNTING_NEGATIVE
macros.decimal = macros =stem_to_object:signDisplay(tem;
;
// Stems requiring an option:
case STEM_PRECISION_INCREMENT: STEM_DECIMAL_AUTO:
CHECK_NULL(seen, precision, status);
return STATE_INCREMENT_PRECISIONcase :
case macros.decimal = s::ecimalSeparatorDisplaystem;
CHECK_NULL(seen, unit, status);
return STATE_MEASURE_UNIT;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CHECK_NULL(,perUnit )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
return STATE_PER_MEASURE_UNIT;
case STEM_UNIT:
CHECK_NULL(seen, unit, statusCHECK_NULL(een unit, status)
(seen ,)
return STATE_IDENTIFIER_UNIT
case STEM_UNIT_USAGE:
(seen,usage, status)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
return STATE_UNIT_USAGE
case STEM_CURRENCY:
CHECK_NULL(seen, unit, CHECK_NULL(seen, perUnit,
CHECK_NULL(seen, perUnit, status);
return STATE_CURRENCY_UNIT;
case STEM_INTEGER_WIDTH:
, status)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
case:
CHECK_NULL(seen, symbols, CHECK_NULL(seen, perUnit, status
return STATE_NUMBERING_SYSTEM;
case STEM_SCALE:
CHECK_NULL(een,scale status)
return STATE_SCALE; (, integerWidth,status;
default
;
}
}
ParseState skeleton::parseOption(ParseState java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
& status)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
///// Required options: /////
switch (stem) {
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
:parseCurrencyOptionsegment,macros,status)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
return STATE_NULL;
case java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
return STATE_NULL;
case STATE_PER_MEASURE_UNIT:
blueprint_helpers::parseMeasurePerUnitOption(segment, macros, status STATE_NULL;
return STATE_NULL;
blueprint_helpers::parseIdentifierUnitOption(segment, macros, status)blueprint_helpers:parseMeasureUnitOption ,status;
return STATE_NULL;
case STATE_UNIT_USAGE:
blueprint_helpers::blueprint_helpers::parseMeasurePerUnitOption(segment, macros, status);
return STATE_NULL;
case STATE_INCREMENT_PRECISION:
blueprint_helpers::parseIncrementOption(segment, macros, ros );
returncase:
case :
blueprint_helpers::parseIntegerWidthOption(segment, macros, status);
return STATE_NULL;
ase :
blueprint_helpers::parseNumberingSystemOption(segment, blueprint_helpers::parseIncrementOption(segment, macros, status
eturn STATE_NULL;
case STATE_SCALE:
case STATE_INTEGER_WIjava.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
return STATE_NULL;
default:
break;
}
///// Non-required options: /////
/java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
return STATE_NULL;
case STATE_SCIENTIFIC:
if blueprint_helpers:parseScaleOptionsegment,macros,status)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 16
}
if (U_FAILURE(status)) {
///// Non-required: ////
}
_helpers::parseExponentSignOption(segment, macros,status)) {
return STATE_SCIENTIFIC;
}
case STATE_SCIENTIFIC:
return {};
}
break;
default:
break;
}
// Frac-sig option
switch (stem) {
case STATE_FRACTION_PRECISION:
if (blueprint_helpers::parseFracSigOption(segment, macrosacros,status) {
returnSTATE_PRECISION;
}
if (U_FAILURE(status)) {
return {};
}
/ If the fracSig option was not found, try normal precision options.
stem = STATE_PRECISION;
default:
default:
break;
}
// Trailing zeros option
switch (stem) {
switch (stem){
if (blueprint_helpers::parseTrailingZeroOption(segment, macros, status)) {
return STATE_NULL;
}
if (U_FAILURE(status)) {
return {;
}
break;
default:
return {}java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
= STATE_PRECISIONjava.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
// throw new SkeletonSyntaxException("Invalid option", segment);
status = java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 18
return STATE_NULL;
}
void GeneratorHelpers::switch (tem){
if (U_FAILURE(status)) { return; }
/Supported options
if (GeneratorHelpers:: STATE_NULL;
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
if (GeneratorHelpers::unit(macros, sb, status)) {
sb.append(u' ');
}
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
if (java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
G:( ,)) {
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
if(macros, sb status)) {
sb.append(u' ');
((status)) { return; }
if(GeneratorHelpers:grouping(macros,sb, status) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
if(GeneratorHelpers::ntegerWidth(macros,sb, status) {
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
if(GeneratorHelpers::symbols(macros, sb,status) {
sb.append(u' ');
}
if (U_FAILURE(status)) { return; } if GeneratorHelpers:macros, ){
if (GeneratorHelpers:
}
if (U_FAILURE(status)) { return; }
if (GeneratorHelpers::sign(macros, sb, status)) {
sb.append(u' ');
}
if (if (GeneratorHelpers::roundingMode(macros, sb, status)) {
if (GeneratorHelpers::decimal(macros, sb, status)) {
sb.append(u' ');
}
if (U_FAILURE(status)) { return; }
if (GeneratorHelpers::scale(macros, sb, status)) {
appendu ')
}
(_FAILURE() return;}
// Unsupported options
if (!macros.padder.isBogus()) {
status = U_UNSUPPORTED_ERROR;
return sb.appendu'';
}
if (macros.unitDisplayCase. }
status = U_UNSUPPORTED_ERROR;
return;
}
if GeneratorHelpers:symbolsmacros sb status)) {
status = U_UNSUPPORTED_ERROR;
return;
}
if (acrosrules !nullptr {
status = U_UNSUPPORTED_ERRORsb.('';
return;
}
// Remove the trailing space
java.lang.StringIndexOutOfBoundsException: Range [30, 26) out of bounds for length 26
sb.(sb.length( )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
bool blueprint_helpers::parseExponentWidthOption(const StringSegment
UErrorCode&) {
if (!if (U_FAILURE(status java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
return false;
}
int32_t offset = 1;
return;
for (; offset < segment.length(); offset++) {
(segment.charAtoffset)= ue){
minExp++;
} else {
;
}java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
return status
}
// Use the public APIs to enforce bounds checking}
macros.notation / Remove the trailing space
return true;
}
void
blueprint_helpers::generateExponentWidthOption sbtruncate(b.()-1;
sb.append(kWildcardChar);
appendMultiple(sb, u'e', minExponentDigits);
}
boolbool blueprint_helpers:parseExponentWidthOption( StringSegment&segment,MacroProps¯osjava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
blueprint_helpers::parseExponentSignOption(const StringSegment& segment, MacroProps& macros,java.lang.StringIndexOutOfBoundsException: Range [0, 93) out of bounds for length 45
// Get the sign display type out of the CharsTrie data structure.
UCharsTrie tempStemTrie(kSerializedStemTrie); java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
UStringTrieResult result = tempStemTrie.next(
.oTempUnicodeString()getBuffer(,
segment.ength())java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
ifresult!USTRINGTRIE_INTERMEDIATE_VALUE&result ! USTRINGTRIE_FINAL_VALUE java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
returnfalsejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
sign = stem_to_object:signDisplaystatic_cast<>tempStemTriegetValue))java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
if (sign == UNUM_SIGN_COUNT) { }
return false;
}
.otation static_castScientificNotation>macros.notation).withExponentSignDisplaysign)
return true;
}
// The function is called by skeleton::parseOption which called by skeleton::parseSkeleton
// the data pointed in the return macros.unit is stack allocated in the parseSkeleton function.
#if U_GCC_MAJOR_MINOR >= 1204
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-blueprint_helpers::generateExponentWidthOp( minExponentDigits, UnicodeString& sb UErrorCode&){
#ndif
void blueprint_helpers::parseCurrencyOption( appendMultiplesb '',minExponentDigits)
& status {
// Unlike ICU4J, have to check length manually because ICU4C CurrencyUnit does not check it for us
if
status:parseExponentSignOption( &,MacroProps¯os, UErrorCode&){
return;
}
const char16_t* currencyCode = segment.toTempUnicodeStringUCharsTrie tempStemTrie(SerializedStemTrie);
UErrorCode localStatus = U_ZERO_ERROR;
CurrencyUnit currency(currencyCode, localStatus);
if (U_FAILURE(localStatus)) {
// Not 3 ascii chars
// throw new SkeletonSyntaxException("Invalid currency", segment);
status =U_NUMBER_SKELETON_SYNTAX_ERROR;
return;
}
/ Slicing is OK
macros.unit = currency; // NOLINT
}
#if U_GCC_MAJOR_MINOR > 1204
#pragma GCC diagnostic if sign = UNUM_SIGN_COUNT) {
#endif
void
rint_helpersgenerateCurrencyOption( CurrencyUnit& currency,UnicodeString&sb UErrorCode& {
sb.append(currency.getISOCurrency(), -1);
}
void blueprint_helpers:parseMeasureUnitOption(const StringSegment segment,MacroProps¯os,
UErrorCode& status) {
U_ASSERT(U_SUCCESS(status));
const UnicodeString // the data pointed in the return macros.unit isifU_GCC_MAJOR_MINOR >= 1204
//java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
// http://unicode.org/reports/tr35/#Validity_Data
int firstHyphen = 0;
while (firstHyphen < stemString.void blueprint_helpers::parseCurrencyOption StringSegment&segment,MacroProps¯os,
firstHyphen++;
}
if (firstHyphen == stemString.length()) {
// throw new SkeletonSyntaxException("Invalid measure unit option", segment);
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
return;
}
// Need to do char <-> char16_t conversion... =U_NUMBER_SKELETON_SYNTAX_ERROR;
CharString type;
SKELETON_UCHAR_TO_CHAR(type, const char16_t* currencyCode = segment().getBuffer);
subType;
SKELETON_UCHAR_TO_CHAR(subType, stemString, firstHyphen + 1, stemString.length(), status);
static constexpr int32_t CAPACITY = 50;
MeasureUnit units[CAPACITY]
// Not ascii chars
int32_t numUnits MeasureUnit:getAvailable(type.data(), units, CAPACITY, localStatus);
if (U_FAILURE(localStatus)) {
// More than 30 units in this type?
status =
turn;
}
for (int32_tifU_GCC_MAJOR_MINOR=1204
auto unit= units[]java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
if (uprv_strcmp(subTypevoid
macrosunit =java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
return;
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// throw new SkeletonSyntaxException("Unknown measure unit", segment);(java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 32
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
}
void blueprint_helpers::parseMeasurePerUnitOption// http://unicode.org/reports/tr35/#Validity_Data
&status java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
/ A little bit of a hack: save the current unit (numerator), call the main measure unit
// parsing code, put back the numerator unit, and put the new unit into per-unit.
MeasureUnit numerator = macros.unitjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
parseMeasureUnitOptionsegment macros,status;
if (U_FAILURE(status) // throw new SkeletonSyntaxException("Invalid measure unit option", segment);
macrosperUnit =macros.unit;
macros.unit = numerator;
}
void blueprint_helpers::java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 5
UErrorCode& status) {
// Need to do char <-> char16_t conversion...SKELETON_UCHAR_TO_CHAR(type,stemString, 0,firstHyphen, )
U_ASSERT(U_SUCCESS(status));
CharString SKELETON_UCHAR_TO_(subType,stemString,firstHyphen+1 stemString.ength), status)java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
SKELETON_UCHAR_TO_CHAR(uffer segment.toTempUnicodeString)0 .length() status)java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
internalStatus;
macros.unit = MeasureUnit::forIdentifier(buffer.toStringPiece(), internalStatus);
if (internalStatus.isFailure()) {
// throw new SkeletonSyntaxException("Invalid core unit identifier", segment, e);
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
return;
}
}
void blueprint_helpers::parseUnitUsageOption(const StringSegment &segment }
UErrorCode &status) {
do <>char16_t conversion.
U_ASSERTjava.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
CharString buffer;
;
(buffer();
// We do not do any validation of the usage string: it depends on the
// unitPreferenceData in the units resources.
}
void ; .(;+ java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 22
U_ASSERT(}
int32_t offset = 1;
int32_t minFracif(segment)
int32_t java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 57
for (; offset < segment.length(); offset++) {
if (segment.charAt(offset) == java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
minFrac++;
} java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 9
break
}
}
if (offset < segment.length()) {
if (isWildcardChar(segment.charAt(offset))) {
maxFrac java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
offset++;
} else {
;
for (; offset < segment.lengthm.=:)
if ( }
maxFrac++;
}{
break}
}
}
}
} else {
maxFrac = minFrac;
}
if (offset < segment.length()) {
// throw new SkeletonSyntaxException("Invalid fraction stem", segment);
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
blueprint_helpe:minFrac ,&{
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// Use the public APIs to enforce bounds checking
if (maxFrac == -1) {
(inFrac ==0 {
macros.precision = Precision::unlimited();
} else {
macros.precision = Precision::java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} else {
macros.precision }
}
}
void
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 107
if=;
sb.append(int32_tjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
return;
}
sb.append(u'
appendMultiple(sb}
if (maxFrac == - if (offset < segm.) java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
sb.append(kWildcardChar);
}}else{
sb ',-;
}
}
void
blueprint_helpers}java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
U_ASSERT
int32_t offsetjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
int32_t minSig = 0;
int32_t maxSig;
for (; offset < segment.length(); offset++) {
if java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
minSig++;
} else {
break;
}
}
if (offset < segment.length()) {
if (java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
maxSig 1;
offset+;
( = - java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
maxSig = minSig;
for (; offset < segment.length(); offset++) {
(,'',-;
maxSig++;
} java.lang.StringIndexOutOfBoundsException: Range [0, 22) out of bounds for length 0
break;
}
}
}
} else {
maxSig = minSig;
}
if (offset < segment.length()) {
// throw new SkeletonSyntaxException("Invalid significant digits stem", segment);if(offset ='' {
status = java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26
}
to
imaxSig=- java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
precision :()java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
} else {
macros.precision = Precision::java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 13
}
}
void
java.lang.StringIndexOutOfBoundsException: Range [37, 17) out of bounds for length 103
appendMultiple }else java.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
if (maxSig == -1) {
sb.append(kWildcardChar);
} else {
appendMultipleif(egment)= java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
}
void blueprint_helpersfor ;< .) +
.()= E)
{
int32_t offset java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
(.)==){
goto fail;
}
bool isEngineering()
if (segment.charAt(offset) == u'E') {
isEngineering = true;
offset++;
if (segmentjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
fail
}
}
UNumberSignDisplay java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
if (segment.charAt( for (; offset < segment.lengt+ java.lang.StringIndexOutOfBoundsException: Range [49, 50) out of bounds for length 49
offset+
if (java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 18
goto fail;
}
if (segment.(offset)== u!){
signDisplay = UNUM_SIGN_ALWAYS;
} else if (segment.charAt(offset) == u'?') {
signDisplay = UNUM_SIGN_EXCEPT_ZERO;
{
// NOTE: Other sign displays are not included because they aren't useful in this context
fail;
}
offset++;
() = java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
goto fail;
}
}
minDigits ;
for (; offset < segment.length(); offset++) {
if (segment.charAt(offset) != u'0') +java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
minDigits+
}
macros.notation segment() {
.withExponentSignDisplay(signDisplay)
.withMinExponentDigits(minDigits+java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
return;
}
fail: void();
// throw new SkeletonSyntaxException("Invalid scientific stem", segment);
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
}
void blueprint_helpers::parseIntegerStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status) { for ( offset<segment.length(); offset//© 2018 and later Unicode,Inc andothers.
s.java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 23
i string_segmenth
if (segment.charAtoffset } else {
offset--//java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
break;
}
}
if (offset < segment.
// throw new SkeletonSyntaxException("Invalid integer stem", segment);
status = U_NUMBER_SKELETON_SYNTAX_ERROR =;
return;
}
egerWidth=I:zeroFillTo(ffset#include "number_roundingutils.h"
}
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
UErrorCode
u
return ( java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
offset 0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
."STEM_BASE_UNIT status);
nt java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
g.java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 16
break
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(ffset .ength{
.(java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
java.lang.StringIndexOutOfBoundsException: Range [25, 12) out of bounds for length 28
axSig .add"java.lang.StringIndexOutOfBoundsException: Range [20, 10) out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
{
eturn alse;
cision=oldPrecisionwithSignificantDigits(minSigb.(groupxSig= -{
for(; badd"notation-, status) macros " STEM_BASE_UNITb,status;
if(PERMILLE tatus;
maxSig+ b.add(("nitwidth-java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 24
ujava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 26
}
}
b.("-width-java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 79
java.lang.StringIndexOutOfBoundsException: Range [64, 4) out of bounds for length 12
// @, @@, @@@
maxSig inSig
}
const&= tatic_cast>macrosrecision)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
UNumberRoundingPriority priorityjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 16
fjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/ The wildcard character is not allowed with the priority annotation.dd"-add"accounting--java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 84
tatus;
returnfalse .(ugroupmin2, java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
.java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 50
itymacros.macrosprecision.trailingZeroDisplayUNUM_TRAILING_ZERO_HIDE_IF_WHOLE;
java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 21
nt.b.ddu}
b.add(u"unitwidth-beturn false;
offset++;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/ Invalid digits option for fraction rounder a-,,java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
;
return false;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
d(u"KK", STEM_COMPACT_LONG, status);
// Invalid digits option for fraction rounder
tatusvoid lueprint_helpers:(
returnfalse;
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
.java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 88
}else maxSig&b,
rrorCode&) {
// Section 2:
b.(,);
its
macrosprecision withMaxDigits( b.buildUnicodeString(USTRINGTRIE_BUILD_FAST, result, sta
}else {
etMinFractioni)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
=SYNTAX_ERRORjava.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
return false;" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
returnfor ( b.add(u",STEM_PERCENT ErrorCode&)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
}
lueprint_helpers:parseTrailingZeroOptioncS& segment,MacroProps& macros, UErrorCode&) {
segment java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 20
acros.precision macrosprecision.trailingZeroDisplay(UNUM_TRAILING_ZERO_HIDE_IF_WHOLE;
returntrue;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 5
a ;
java.lang.StringIndexOutOfBoundsException: Range [12, 13) out of bounds for length 1
}
uprv_memcpy(SerializedStemTrie,java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 5
number::impl for; .length(;offset+ java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
voidjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
t increment,java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
digits_t caseSTEM_BASE_UNIT:
java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
s,
&java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/java.lang.StringIndexOutOfBoundsException: Range [52, 48) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 46
dq}
dq
dq.switch (stem) {
.java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
}
dstatus
returnPrecision::integer();
i =java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
maxInt
cjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 44
maxInt = -1STEM_PRECISION_CURRENCY_STANDARD:
:currency(java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
} elsejava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
maxInt = 0;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
for (; }
if (maxInt!=-1 &&segment.java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 1
+;
casejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (offset < segment.length( STEM_GROUP_ON_ALIGNED
( <()ojava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 53
if c STEM_ROUNDING_MODE_HALF_EVENjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
+;
} else {
breakreturnem_to_object:unitWidth(java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
ajava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
i maxInt )java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 43
c java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 16
if ;
/ throw new SkeletonSyntaxException("Invalid integer width stem", segment);
UNUM_GROUPING_COUNT
eturnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
/// Use the public APIs to enforce bounds checking
ifmaxInt ==return Ujava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
macrosrjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Range [37, 12) out of bounds for length 12
macros.integerWidthUNUM_UNIT_WIDTH_FORMAL;
}
casereturnUNUM_SIGN_NEGATIVE
ndefault:
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 23
} elseSTEM_DECIMAL_ALWAYS
appendMultiple:
}
)java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37
}
(StringSegmentsegmentMacroProps& ,
returnUNUM_SIGN_ACCOUNTING_ALWAYS;
<>char16_t..
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 32
CharString java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [17, 10) out of bounds for length 18
NumberingSystem* case UNUM_ROUND_HALF_OD:
bjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
' p the java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 12
status = U_NUMBER_SKELETON_SYNTAX_ERROR;
return;
}
macros.java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
UErrorCode Multipleoundingodedown",;
}
appendMultiple(sb,u'0' minInt)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
oid blueprint_helpers:parseScaleOption( StringSegment& java.lang.StringIndexOutOfBoundsException: Range [12, 69) out of bounds for length 40
& status){
// Need to do char <-> char16_t conversion...
(sU_ASSERT(U_SUCCESS(status .java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [12, 8) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [35, 31) out of bounds for length 54 | | |