1bad1ff34a
- libicule and libiculx do not exist anymore in newer ICU versions (harfbuzz replaces them), but we didn't actually use them, so remove them from the build feature and from the package dependencies - Add namespace usage marcos since the newer ICU packages put ICU things in a namespace, making it easier to have multiple versions of ICU used side by side. No functional change intended, but this makes it possible to build the code with either ICU 57 (for gcc2) or 66 (for other architectures).
83 lines
2.2 KiB
C++
83 lines
2.2 KiB
C++
/*
|
|
* Copyright 2010-2011, Oliver Tappe, zooey@hirschkaefer.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _ICU_MONETARY_DATA_H
|
|
#define _ICU_MONETARY_DATA_H
|
|
|
|
|
|
#include "ICULocaleconvData.h"
|
|
#include "LocaleBackend.h"
|
|
|
|
#include <locale.h>
|
|
|
|
|
|
namespace BPrivate {
|
|
namespace Libroot {
|
|
|
|
|
|
class ICUMonetaryData : public ICULocaleconvData {
|
|
typedef ICULocaleconvData inherited;
|
|
|
|
public:
|
|
static const int32 kParenthesesAroundCurrencyAndValue = 0;
|
|
static const int32 kSignPrecedesCurrencyAndValue = 1;
|
|
static const int32 kSignSucceedsCurrencyAndValue = 2;
|
|
static const int32 kSignImmediatelyPrecedesCurrency = 3;
|
|
static const int32 kSignImmediatelySucceedsCurrency = 4;
|
|
|
|
ICUMonetaryData(pthread_key_t tlsKey,
|
|
struct lconv& localeConv);
|
|
|
|
void Initialize(
|
|
LocaleMonetaryDataBridge* dataBridge);
|
|
|
|
virtual status_t SetTo(const U_NAMESPACE_QUALIFIER Locale&
|
|
locale,
|
|
const char* posixLocaleName);
|
|
virtual status_t SetToPosix();
|
|
|
|
const char* GetLanginfo(int index);
|
|
|
|
private:
|
|
static const int32 kCsPrecedesFlag = 1 << 0;
|
|
static const int32 kSepBySpaceFlag = 1 << 1;
|
|
|
|
int32 _DetermineCurrencyPosAndSeparator(
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& prefix,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& suffix,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& signSymbol,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& currencySymbol,
|
|
UChar& currencySeparatorChar);
|
|
int32 _DetermineSignPos(const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& prefix,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& suffix,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& signSymbol,
|
|
const U_NAMESPACE_QUALIFIER
|
|
UnicodeString& currencySymbol);
|
|
|
|
char fDecimalPoint[skLCBufSize];
|
|
char fThousandsSep[skLCBufSize];
|
|
char fGrouping[skLCBufSize];
|
|
char fIntCurrSymbol[skLCBufSize];
|
|
char fCurrencySymbol[skLCBufSize];
|
|
char fPositiveSign[skLCBufSize];
|
|
char fNegativeSign[skLCBufSize];
|
|
|
|
struct lconv& fLocaleConv;
|
|
const struct lconv* fPosixLocaleConv;
|
|
};
|
|
|
|
|
|
} // namespace Libroot
|
|
} // namespace BPrivate
|
|
|
|
|
|
#endif // _ICU_MONETARY_DATA_H
|