]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/formattedval_sbimpl.cpp
1 // © 2018 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
8 // This file contains one implementation of FormattedValue.
9 // Other independent implementations should go into their own cpp file for
10 // better dependency modularization.
12 #include "formattedval_impl.h"
17 FormattedValueNumberStringBuilderImpl::FormattedValueNumberStringBuilderImpl(number::impl::Field numericField
)
18 : fNumericField(numericField
) {
21 FormattedValueNumberStringBuilderImpl::~FormattedValueNumberStringBuilderImpl() {
25 UnicodeString
FormattedValueNumberStringBuilderImpl::toString(UErrorCode
&) const {
26 return fString
.toUnicodeString();
29 UnicodeString
FormattedValueNumberStringBuilderImpl::toTempString(UErrorCode
&) const {
30 return fString
.toTempUnicodeString();
33 Appendable
& FormattedValueNumberStringBuilderImpl::appendTo(Appendable
& appendable
, UErrorCode
&) const {
34 appendable
.appendString(fString
.chars(), fString
.length());
38 UBool
FormattedValueNumberStringBuilderImpl::nextPosition(ConstrainedFieldPosition
& cfpos
, UErrorCode
& status
) const {
39 // NOTE: MSVC sometimes complains when implicitly converting between bool and UBool
40 return fString
.nextPosition(cfpos
, fNumericField
, status
) ? TRUE
: FALSE
;
46 #endif /* #if !UCONFIG_NO_FORMATTING */