Remove more unneeded files from the Locale Kit
All of this is replaced by the single BNumberFormat class.
This commit is contained in:
@@ -6,15 +6,11 @@
|
||||
#include <Catalog.h>
|
||||
#include <Collator.h>
|
||||
#include <Country.h>
|
||||
#include <Currency.h>
|
||||
#include <Format.h>
|
||||
#include <FormatImpl.h>
|
||||
#include <FormatParameters.h>
|
||||
#include <FormattingConventions.h>
|
||||
#include <GenericNumberFormat.h>
|
||||
#include <IntegerFormat.h>
|
||||
#include <IntegerFormatImpl.h>
|
||||
#include <IntegerFormatParameters.h>
|
||||
#include <Language.h>
|
||||
#include <Locale.h>
|
||||
#include <NumberFormat.h>
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#ifndef _B_CURRENCY_H_
|
||||
#define _B_CURRENCY_H_
|
||||
|
||||
#include <Archivable.h>
|
||||
#include <Message.h>
|
||||
#include <String.h>
|
||||
|
||||
class BLocale;
|
||||
|
||||
class BCurrency : public BArchivable {
|
||||
public:
|
||||
BCurrency(const BCurrency &other);
|
||||
BCurrency(BMessage *archive);
|
||||
BCurrency(const char *currencyCode);
|
||||
~BCurrency();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
virtual status_t Archive(BMessage *archive, bool deep = true) const;
|
||||
static BArchivable *Instantiate(BMessage *archive);
|
||||
|
||||
const char *CurrencyCode() const;
|
||||
const char *DefaultSymbol() const;
|
||||
int32 DefaultFractionDigits() const;
|
||||
|
||||
status_t GetSymbol(char *symbol, size_t maxSize,
|
||||
BLocale *locale = NULL);
|
||||
status_t GetSymbol(BString *symbol, BLocale *locale = NULL);
|
||||
|
||||
BCurrency &operator=(const BCurrency &other);
|
||||
bool operator==(const BCurrency &other) const;
|
||||
bool operator!=(const BCurrency &other) const;
|
||||
|
||||
private:
|
||||
BCurrency();
|
||||
|
||||
bool _CheckData() const;
|
||||
void _Unset(status_t error);
|
||||
|
||||
BString fCurrencyCode;
|
||||
BString fDefaultSymbol;
|
||||
int32 fDefaultFractionDigits;
|
||||
};
|
||||
|
||||
#endif // _B_CURRENCY_H_
|
||||
@@ -1,58 +0,0 @@
|
||||
#ifndef _B_INTEGER_FORMAT_H_
|
||||
#define _B_INTEGER_FORMAT_H_
|
||||
|
||||
#include <NumberFormat.h>
|
||||
#include <IntegerFormatParameters.h>
|
||||
|
||||
class BIntegerFormatImpl;
|
||||
class BString;
|
||||
|
||||
// Note: BIntegerFormat is derived from BIntegerFormatParameters only due
|
||||
// to my laziness. The parameters should probably be a private member
|
||||
// and this class (and its base classes) should mirror the parameters
|
||||
// classes' accessor methods.
|
||||
//
|
||||
class BIntegerFormat : public BNumberFormat, public BIntegerFormatParameters {
|
||||
public:
|
||||
BIntegerFormat(const BIntegerFormat &other);
|
||||
~BIntegerFormat();
|
||||
|
||||
// formatting
|
||||
|
||||
// no-frills version: Simply appends the formatted number to the
|
||||
// string buffer. Can fail only with B_NO_MEMORY or B_BAD_VALUE.
|
||||
status_t Format(int64 number, BString *buffer) const;
|
||||
|
||||
// Appends the formatted number to the string buffer. Additionally
|
||||
// one can get the positions of certain fields in the formatted
|
||||
// number by supplying format_field_position structures with the
|
||||
// field_type set respectively. Passing true for allFieldPositions
|
||||
// will make the method fill in a format_field_position structure for
|
||||
// each field it writes -- the field_type values will be ignored and
|
||||
// overwritten.
|
||||
// In fieldCount, in case it is non-null, the number of fields
|
||||
// written is returned.
|
||||
// B_BUFFER_OVERFLOW is returned, if allFieldPositions is true and
|
||||
// the positions buffer is too small (fieldCount will be set
|
||||
// nevertheless, so that the caller can adjust the buffer size to
|
||||
// make them all fit).
|
||||
status_t Format(int64 number, BString *buffer,
|
||||
format_field_position *positions,
|
||||
int32 positionCount = 1,
|
||||
int32 *fieldCount = NULL,
|
||||
bool allFieldPositions = false) const;
|
||||
|
||||
// TODO: Format() versions for (char* buffer, size_t bufferSize)
|
||||
// instead of BString*. And, of course, versions for the other
|
||||
// number types (uint64, uint32,...).
|
||||
|
||||
// parsing
|
||||
// TODO: ...
|
||||
|
||||
BIntegerFormat &operator=(const BIntegerFormat &other);
|
||||
|
||||
BIntegerFormat(BIntegerFormatImpl *impl); // conceptually private
|
||||
};
|
||||
|
||||
|
||||
#endif // _B_INTEGER_FORMAT_H_
|
||||
@@ -1,36 +0,0 @@
|
||||
#ifndef _B_INTEGER_FORMAT_IMPL_H_
|
||||
#define _B_INTEGER_FORMAT_IMPL_H_
|
||||
|
||||
struct format_field_position;
|
||||
class BIntegerFormatParameters;
|
||||
class BString;
|
||||
|
||||
class BIntegerFormatImpl {
|
||||
public:
|
||||
BIntegerFormatImpl();
|
||||
virtual ~BIntegerFormatImpl();
|
||||
|
||||
// formatting
|
||||
|
||||
virtual status_t Format(const BIntegerFormatParameters *parameters,
|
||||
int64 number, BString *buffer) const = 0;
|
||||
virtual status_t Format(const BIntegerFormatParameters *parameters,
|
||||
int64 number, BString *buffer,
|
||||
format_field_position *positions,
|
||||
int32 positionCount = 1,
|
||||
int32 *fieldCount = NULL,
|
||||
bool allFieldPositions = false) const = 0;
|
||||
|
||||
// TODO: ...
|
||||
|
||||
virtual BNumberFormatParameters *DefaultNumberFormatParameters();
|
||||
virtual const BNumberFormatParameters *DefaultNumberFormatParameters()
|
||||
const;
|
||||
|
||||
virtual BIntegerFormatParameters *DefaultIntegerFormatParameters() = 0;
|
||||
virtual const BIntegerFormatParameters *DefaultIntegerFormatParameters()
|
||||
const = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // _B_INTEGER_FORMAT_IMPL_H_
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef _B_INTEGER_FORMAT_PARAMETERS_H_
|
||||
#define _B_INTEGER_FORMAT_PARAMETERS_H_
|
||||
|
||||
#include <NumberFormatParameters.h>
|
||||
|
||||
class BIntegerFormatParameters : public BNumberFormatParameters {
|
||||
public:
|
||||
BIntegerFormatParameters(const BIntegerFormatParameters *parent = NULL);
|
||||
BIntegerFormatParameters(const BIntegerFormatParameters &other);
|
||||
~BIntegerFormatParameters();
|
||||
|
||||
void SetParentIntegerParameters(const BIntegerFormatParameters *parent);
|
||||
const BIntegerFormatParameters *ParentIntegerParameters() const;
|
||||
|
||||
BIntegerFormatParameters &operator=(
|
||||
const BIntegerFormatParameters &other);
|
||||
|
||||
private:
|
||||
const BIntegerFormatParameters *fParent;
|
||||
};
|
||||
|
||||
#endif // _B_INTEGER_FORMAT_PARAMETERS_H_
|
||||
Reference in New Issue
Block a user