@@ -398,7 +398,7 @@ bool isDigitSizeOption(const UnicodeString& s) {
398398 CHECK_ERROR (status);
399399 for (int32_t i = 0 ; i < opts.optionsCount (); i++) {
400400 const ResolvedFunctionOption& opt = opts.options [i];
401- if (isDigitSizeOption (opt.getName ()) && !isInteger (opt.getValue ().getOperand ())) {
401+ if (isDigitSizeOption (opt.getName ()) && !isInteger (opt.getValue ().unwrap ())) {
402402 status = U_MF_BAD_OPTION;
403403 return ;
404404 }
@@ -673,7 +673,7 @@ int32_t StandardFunctions::Number::digitSizeOption(const FunctionOptions& opts,
673673 localStatus = U_ZERO_ERROR;
674674 }
675675 // Next try the operand
676- val = getInt64Value (Locale (" en-US" ), opt->getOperand (), localStatus);
676+ val = getInt64Value (Locale (" en-US" ), opt->unwrap (), localStatus);
677677 if (U_SUCCESS (localStatus)) {
678678 return static_cast <int32_t >(val);
679679 }
@@ -738,7 +738,7 @@ StandardFunctions::NumberValue::NumberValue(const Number& parent,
738738
739739 locale = context.getLocale ();
740740 opts = options.mergeOptions (arg.getResolvedOptions (), errorCode);
741- operand = arg.getOperand ();
741+ innerValue = arg.unwrap ();
742742 functionName = UnicodeString (parent.isInteger ? " integer" : " number" );
743743 inputDir = context.getDirection ();
744744 dir = numberOutputDirectionalityFromUDir (inputDir, locale);
@@ -749,31 +749,31 @@ StandardFunctions::NumberValue::NumberValue(const Number& parent,
749749 int64_t integerValue = 0 ;
750750
751751 if (U_SUCCESS (errorCode)) {
752- switch (operand .getType ()) {
752+ switch (innerValue .getType ()) {
753753 case UFMT_DOUBLE: {
754- double d = operand .getDouble (errorCode);
754+ double d = innerValue .getDouble (errorCode);
755755 U_ASSERT (U_SUCCESS (errorCode));
756756 formattedNumber = realFormatter.formatDouble (d, errorCode);
757757 integerValue = static_cast <int64_t >(std::round (d));
758758 break ;
759759 }
760760 case UFMT_LONG: {
761- int32_t l = operand .getLong (errorCode);
761+ int32_t l = innerValue .getLong (errorCode);
762762 U_ASSERT (U_SUCCESS (errorCode));
763763 formattedNumber = realFormatter.formatInt (l, errorCode);
764764 integerValue = l;
765765 break ;
766766 }
767767 case UFMT_INT64: {
768- int64_t i = operand .getInt64 (errorCode);
768+ int64_t i = innerValue .getInt64 (errorCode);
769769 U_ASSERT (U_SUCCESS (errorCode));
770770 formattedNumber = realFormatter.formatInt (i, errorCode);
771771 integerValue = i;
772772 break ;
773773 }
774774 case UFMT_STRING: {
775775 // Try to parse the string as a number
776- const UnicodeString& s = operand .getString (errorCode);
776+ const UnicodeString& s = innerValue .getString (errorCode);
777777 U_ASSERT (U_SUCCESS (errorCode));
778778 double d = parseNumberLiteral (s, errorCode);
779779 if (U_FAILURE (errorCode))
@@ -797,7 +797,7 @@ StandardFunctions::NumberValue::NumberValue(const Number& parent,
797797
798798 // Need to set the integer value if invoked as :integer
799799 if (parent.isInteger ) {
800- operand = Formattable (integerValue);
800+ innerValue = Formattable (integerValue);
801801 }
802802}
803803
@@ -1066,7 +1066,7 @@ StandardFunctions::DateTimeValue::DateTimeValue(DateTime::DateTimeType type,
10661066
10671067 locale = context.getLocale ();
10681068 opts = options.mergeOptions (arg.getResolvedOptions (), errorCode);
1069- operand = arg.getOperand ();
1069+ innerValue = arg.unwrap ();
10701070 switch (type) {
10711071 case DateTimeType::kDate :
10721072 functionName = functions::DATE;
@@ -1081,7 +1081,7 @@ StandardFunctions::DateTimeValue::DateTimeValue(DateTime::DateTimeType type,
10811081 inputDir = context.getDirection ();
10821082 dir = numberOutputDirectionalityFromUDir (inputDir, locale);
10831083
1084- const Formattable* source = &operand ;
1084+ const Formattable* source = &innerValue ;
10851085
10861086 LocalPointer<DateFormat> df;
10871087 Formattable opt;
@@ -1271,7 +1271,7 @@ StandardFunctions::DateTimeValue::DateTimeValue(DateTime::DateTimeType type,
12711271 }
12721272 df->adoptTimeZone (createTimeZone (dateInfo, errorCode));
12731273 df->format (dateInfo.date , result, 0 , errorCode);
1274- operand = message2::Formattable (std::move (dateInfo));
1274+ innerValue = message2::Formattable (std::move (dateInfo));
12751275 break ;
12761276 }
12771277 case UFMT_DATE: {
@@ -1488,13 +1488,13 @@ StandardFunctions::StringValue::StringValue(const FunctionContext& context,
14881488 UErrorCode& status) {
14891489 CHECK_ERROR (status);
14901490 locale = context.getLocale ();
1491- operand = val.getOperand ();
1491+ innerValue = val.unwrap ();
14921492 functionName = UnicodeString (" string" );
14931493 inputDir = context.getDirection ();
14941494 dir = stringOutputDirectionFromInput (inputDir);
14951495 // No options
14961496 // Convert to string
1497- formattedString = formattableToString (context.getLocale (), operand , status);
1497+ formattedString = formattableToString (context.getLocale (), innerValue , status);
14981498}
14991499
15001500void StandardFunctions::StringValue::selectKeys (const UnicodeString* keys,
@@ -1601,7 +1601,7 @@ static void setFailsFromFunctionValue(const FunctionValue& optionValue,
16011601 bool & failsFormat,
16021602 bool & failsSelect,
16031603 UErrorCode& status) {
1604- UnicodeString failsString = optionValue.getOperand ().getString (status);
1604+ UnicodeString failsString = optionValue.unwrap ().getString (status);
16051605 if (U_SUCCESS (status)) {
16061606 // 9i. If its value resolves to the string 'always', then
16071607 if (failsString == u" always" ) {
@@ -1655,7 +1655,7 @@ static void setFailsFromFunctionValue(const FunctionValue& optionValue,
16551655 // 5. If arg is the resolved value of an expression with a :test:function, :test:select, or :test:format annotation for which resolution has succeeded, then
16561656 if (isTestFunction (arg.getFunctionName ())) {
16571657 // 5i. Let Input be the Input value of arg.
1658- input = formattableToNumber (arg.getOperand (), status);
1658+ input = formattableToNumber (arg.unwrap (), status);
16591659 if (U_FAILURE (status)) {
16601660 status = U_MF_OPERAND_MISMATCH_ERROR;
16611661 return ;
@@ -1664,7 +1664,7 @@ static void setFailsFromFunctionValue(const FunctionValue& optionValue,
16641664 // 5ii. Set DecimalPlaces to be DecimalPlaces value of arg.
16651665 const FunctionValue* decimalPlacesFunctionValue = opts.getFunctionOption (UnicodeString (" decimalPlaces" ), status);
16661666 if (U_SUCCESS (status)) {
1667- decimalPlaces = formattableToNumber (decimalPlacesFunctionValue->getOperand (), status);
1667+ decimalPlaces = formattableToNumber (decimalPlacesFunctionValue->unwrap (), status);
16681668 if (U_FAILURE (status)) {
16691669 status = U_MF_OPERAND_MISMATCH_ERROR;
16701670 return ;
@@ -1689,7 +1689,7 @@ static void setFailsFromFunctionValue(const FunctionValue& optionValue,
16891689 // (Done in previous step)
16901690 } else {
16911691 // 6. Else if arg is a numerical value or a string matching the number-literal production, then
1692- input = formattableToNumber (arg.getOperand (), status);
1692+ input = formattableToNumber (arg.unwrap (), status);
16931693 if (U_FAILURE (status)) {
16941694 // 7. Else,
16951695 // 7i. Emit "bad-input" Resolution Error.
@@ -1704,7 +1704,7 @@ static void setFailsFromFunctionValue(const FunctionValue& optionValue,
17041704 if (U_SUCCESS (status)) {
17051705 // 8i. If its value resolves to a numerical integer value 0 or 1
17061706 // or their corresponding string representations '0' or '1', then
1707- double decimalPlacesInput = formattableToNumber (decimalPlacesOpt->getOperand (), status);
1707+ double decimalPlacesInput = formattableToNumber (decimalPlacesOpt->unwrap (), status);
17081708 if (U_SUCCESS (status)) {
17091709 if (decimalPlacesInput == 0 || decimalPlacesInput == 1 ) {
17101710 // 8ia. Set DecimalPlaces to be the numerical value of the option.
@@ -1745,7 +1745,7 @@ StandardFunctions::TestFunctionValue::TestFunctionValue(const TestFunction& pare
17451745 failsFormat, failsSelect, input, status);
17461746 CHECK_ERROR (status);
17471747 opts = options.mergeOptions (arg.getResolvedOptions (), status);
1748- operand = arg.getOperand ();
1748+ innerValue = arg.unwrap ();
17491749 canFormat = parent.canFormat ;
17501750 canSelect = parent.canSelect ;
17511751 functionName = UnicodeString (canFormat && canSelect ?
0 commit comments