LocaleKit: remove obsolete files.

Formatting floats is handled by BNumberFormat already.
This commit is contained in:
Adrien Destugues
2017-07-22 12:59:12 +02:00
parent e433b3cfc3
commit 1d6af34b9a
8 changed files with 0 additions and 424 deletions
-3
View File
@@ -7,9 +7,6 @@
#include <Collator.h>
#include <Country.h>
#include <Currency.h>
#include <FloatFormat.h>
#include <FloatFormatImpl.h>
#include <FloatFormatParameters.h>
#include <Format.h>
#include <FormatImpl.h>
#include <FormatParameters.h>
-53
View File
@@ -1,53 +0,0 @@
#ifndef _B_FLOAT_FORMAT_H_
#define _B_FLOAT_FORMAT_H_
#include <NumberFormat.h>
#include <FloatFormatParameters.h>
class BString;
class BFloatFormatImpl;
class BFloatFormat : public BNumberFormat, public BFloatFormatParameters {
public:
BFloatFormat(const BFloatFormat &other);
~BFloatFormat();
// 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(double 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(double 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 (float).
// parsing
// TODO: ...
BFloatFormat &operator=(const BFloatFormat &other);
BFloatFormat(BFloatFormatImpl *impl); // conceptually private
};
#endif // _B_FLOAT_FORMAT_H_
-37
View File
@@ -1,37 +0,0 @@
#ifndef _B_FLOAT_FORMAT_IMPL_H_
#define _B_FLOAT_FORMAT_IMPL_H_
struct format_field_position;
class BFloatFormatParameters;
class BString;
class BFloatFormatImpl {
public:
BFloatFormatImpl();
virtual ~BFloatFormatImpl();
// formatting
virtual status_t Format(const BFloatFormatParameters *parameters,
double number, BString *buffer) const = 0;
virtual status_t Format(const BFloatFormatParameters *parameters,
double 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 BFloatFormatParameters *DefaultFloatFormatParameters() = 0;
virtual const BFloatFormatParameters *DefaultFloatFormatParameters()
const = 0;
};
#endif // _B_FLOAT_FORMAT_IMPL_H_
-54
View File
@@ -1,54 +0,0 @@
#ifndef _B_FLOAT_FORMAT_PARAMETERS_H_
#define _B_FLOAT_FORMAT_PARAMETERS_H_
#include <NumberFormatParameters.h>
enum float_format_type {
B_FIXED_POINT_FLOAT_FORMAT,
B_SCIENTIFIC_FLOAT_FORMAT,
B_AUTO_FLOAT_FORMAT, // picks one of the above depending of the
// number to be formatted
};
class BFloatFormatParameters : public BNumberFormatParameters {
public:
BFloatFormatParameters(const BFloatFormatParameters *parent = NULL);
BFloatFormatParameters(const BFloatFormatParameters &other);
~BFloatFormatParameters();
void SetMinimalFractionDigits(size_t minFractionDigits);
size_t MinimalFractionDigits() const;
void SetMaximalFractionDigits(size_t maxFractionDigits);
size_t MaximalFractionDigits() const;
void SetUseUpperCase(bool useCapitals);
bool UseUpperCase() const;
void SetFloatFormatType(float_format_type type);
float_format_type FloatFormatType() const;
void SetAlwaysUseFractionSeparator(bool alwaysUseFractionSeparator);
bool AlwaysUseFractionSeparator() const;
void SetKeepTrailingFractionZeros(bool keepTrailingFractionZeros);
bool KeepTrailingFractionZeros() const;
void SetParentFloatParameters(const BFloatFormatParameters *parent);
const BFloatFormatParameters *ParentFloatParameters() const;
BFloatFormatParameters &operator=(
const BFloatFormatParameters &other);
private:
const BFloatFormatParameters *fParent;
size_t fMinimalFractionDigits;
size_t fMaximalFractionDigits;
bool fUseUpperCase;
float_format_type fFloatFormatType;
bool fAlwaysUseFractionSeparator;
bool fKeepTrailingFractionZeros;
uint32 fFlags;
};
#endif // _B_FLOAT_FORMAT_PARAMETERS_H_