#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#ifndef __SOURCE_NUMBER_SKELETONS_H__
#define __SOURCE_NUMBER_SKELETONS_H__
#include "number_types.h"
#include "numparse_types.h"
#include "unicode/ucharstrie.h"
#include "string_segment.h"
U_NAMESPACE_BEGIN
namespace number {
namespace impl {
struct SeenMacroProps;
namespace skeleton {
enum ParseState { … };
enum StemEnum { … };
constexpr char16_t kWildcardChar = …;
constexpr char16_t kAltWildcardChar = …;
inline bool isWildcardChar(char16_t c) { … }
UnlocalizedNumberFormatter create(
const UnicodeString& skeletonString, UParseError* perror, UErrorCode& status);
UnicodeString generate(const MacroProps& macros, UErrorCode& status);
MacroProps parseSkeleton(const UnicodeString& skeletonString, int32_t& errOffset, UErrorCode& status);
ParseState parseStem(const StringSegment& segment, const UCharsTrie& stemTrie, SeenMacroProps& seen,
MacroProps& macros, UErrorCode& status);
ParseState
parseOption(ParseState stem, const StringSegment& segment, MacroProps& macros, UErrorCode& status);
}
namespace stem_to_object {
Notation notation(skeleton::StemEnum stem);
MeasureUnit unit(skeleton::StemEnum stem);
Precision precision(skeleton::StemEnum stem);
UNumberFormatRoundingMode roundingMode(skeleton::StemEnum stem);
UNumberGroupingStrategy groupingStrategy(skeleton::StemEnum stem);
UNumberUnitWidth unitWidth(skeleton::StemEnum stem);
UNumberSignDisplay signDisplay(skeleton::StemEnum stem);
UNumberDecimalSeparatorDisplay decimalSeparatorDisplay(skeleton::StemEnum stem);
}
namespace enum_to_stem_string {
void roundingMode(UNumberFormatRoundingMode value, UnicodeString& sb);
void groupingStrategy(UNumberGroupingStrategy value, UnicodeString& sb);
void unitWidth(UNumberUnitWidth value, UnicodeString& sb);
void signDisplay(UNumberSignDisplay value, UnicodeString& sb);
void decimalSeparatorDisplay(UNumberDecimalSeparatorDisplay value, UnicodeString& sb);
}
namespace blueprint_helpers {
bool parseExponentWidthOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateExponentWidthOption(int32_t minExponentDigits, UnicodeString& sb, UErrorCode& status);
bool parseExponentSignOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseCurrencyOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateCurrencyOption(const CurrencyUnit& currency, UnicodeString& sb, UErrorCode& status);
void parseMeasureUnitOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseMeasurePerUnitOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseIdentifierUnitOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseUnitUsageOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseFractionStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateFractionStem(int32_t minFrac, int32_t maxFrac, UnicodeString& sb, UErrorCode& status);
void parseDigitsStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateDigitsStem(int32_t minSig, int32_t maxSig, UnicodeString& sb, UErrorCode& status);
void parseScientificStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseIntegerStem(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
bool parseFracSigOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
bool parseTrailingZeroOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void parseIncrementOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void
generateIncrementOption(uint32_t increment, digits_t incrementMagnitude, int32_t minFrac, UnicodeString& sb, UErrorCode& status);
void parseIntegerWidthOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateIntegerWidthOption(int32_t minInt, int32_t maxInt, UnicodeString& sb, UErrorCode& status);
void parseNumberingSystemOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateNumberingSystemOption(const NumberingSystem& ns, UnicodeString& sb, UErrorCode& status);
void parseScaleOption(const StringSegment& segment, MacroProps& macros, UErrorCode& status);
void generateScaleOption(int32_t magnitude, const DecNum* arbitrary, UnicodeString& sb,
UErrorCode& status);
}
class GeneratorHelpers { … };
struct SeenMacroProps { … };
namespace {
#define SKELETON_UCHAR_TO_CHAR(dest, src, start, end, status) …
}
}
}
U_NAMESPACE_END
#endif
#endif