11 #ifndef __SIMPLEFORMATTER_H__
12 #define __SIMPLEFORMATTER_H__
21 #if U_SHOW_CPLUSPLUS_API
28 namespace number::impl {
78 applyPattern(pattern, errorCode);
97 applyPatternMinMaxArguments(pattern, min, max, errorCode);
105 : compiledPattern(other.compiledPattern) {}
130 return applyPatternMinMaxArguments(pattern, 0,
INT32_MAX, errorCode);
149 int32_t min, int32_t max,
UErrorCode &errorCode);
156 return getArgumentLimit(compiledPattern.getBuffer(), compiledPattern.length());
235 int32_t *offsets, int32_t offsetsLength,
UErrorCode &errorCode)
const;
261 int32_t *offsets, int32_t offsetsLength,
UErrorCode &errorCode)
const;
269 return getTextWithNoArguments(
270 compiledPattern.getBuffer(),
271 compiledPattern.length(),
276 #ifndef U_HIDE_INTERNAL_API
293 return getTextWithNoArguments(
294 compiledPattern.getBuffer(),
295 compiledPattern.length(),
313 static inline int32_t getArgumentLimit(
const char16_t *compiledPattern,
314 int32_t compiledPatternLength) {
315 return compiledPatternLength == 0 ? 0 : compiledPattern[0];
318 static UnicodeString getTextWithNoArguments(
319 const char16_t *compiledPattern,
320 int32_t compiledPatternLength,
322 int32_t offsetsLength);
324 static UnicodeString &format(
325 const char16_t *compiledPattern, int32_t compiledPatternLength,
326 const UnicodeString *
const *values,
327 UnicodeString &result,
const UnicodeString *resultCopy,
UBool forbidResultAsValue,
328 int32_t *offsets, int32_t offsetsLength,
332 friend class number::impl::SimpleModifier;
UMemory is the common ICU base class.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
#define INT32_MAX
The largest value a 32 bit signed integer can hold.
int8_t UBool
The ICU boolean type, a signed-byte integer.
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.