Remove even more Locale Kit cruft.

Not included in the build and not used.
This commit is contained in:
Augustin Cavalier 2017-07-30 14:46:41 -04:00
parent 4e0a6a83d9
commit a1ceb00059
10 changed files with 0 additions and 434 deletions

View File

@ -7,12 +7,9 @@
#include <Collator.h>
#include <Country.h>
#include <Format.h>
#include <FormatImpl.h>
#include <FormatParameters.h>
#include <FormattingConventions.h>
#include <Language.h>
#include <Locale.h>
#include <NumberFormat.h>
#include <NumberFormatParameters.h>
#include <TimeFormat.h>
#include <UnicodeChar.h>

View File

@ -7,7 +7,6 @@
#include <Format.h>
#include <FormatParameters.h>
class BString;

View File

@ -5,7 +5,6 @@
#ifndef _B_FORMAT_H_
#define _B_FORMAT_H_
#include <FormatParameters.h>
#include <FormattingConventions.h>
#include <Locker.h>
#include <Language.h>

View File

@ -1,18 +0,0 @@
#ifndef _B_FORMAT_IMPL_H_
#define _B_FORMAT_IMPL_H_
#include <SupportDefs.h>
class BFormatParameters;
class BFormatImpl {
public:
BFormatImpl();
virtual ~BFormatImpl();
virtual BFormatParameters *DefaultFormatParameters() = 0;
virtual const BFormatParameters *DefaultFormatParameters()
const = 0;
};
#endif // _B_FORMAT_IMPL_H_

View File

@ -1,37 +0,0 @@
#ifndef _B_FORMAT_PARAMETERS_H_
#define _B_FORMAT_PARAMETERS_H_
#include <SupportDefs.h>
enum format_alignment {
B_ALIGN_FORMAT_LEFT, // reuse B_ALIGN_LEFT/B_ALIGN_RIGHT?
B_ALIGN_FORMAT_RIGHT,
};
class BFormatParameters {
public:
BFormatParameters(const BFormatParameters *parent = NULL);
BFormatParameters(const BFormatParameters &other);
~BFormatParameters();
void SetAlignment(format_alignment alignment);
format_alignment Alignment() const;
void SetFormatWidth(size_t width);
size_t FormatWidth() const;
const BFormatParameters *ParentParameters() const;
BFormatParameters &operator=(const BFormatParameters &other);
protected:
void SetParentParameters(const BFormatParameters *parent);
private:
const BFormatParameters *fParent;
format_alignment fAlignment;
size_t fWidth;
uint32 fFlags;
};
#endif // _B_FORMAT_PARAMETERS_H_

View File

@ -1,66 +0,0 @@
#ifndef _B_NUMBER_FORMAT_PARAMETERS_H_
#define _B_NUMBER_FORMAT_PARAMETERS_H_
#include <FormatParameters.h>
enum number_format_sign_policy {
B_USE_NEGATIVE_SIGN_ONLY,
B_USE_SPACE_FOR_POSITIVE_SIGN,
B_USE_POSITIVE_SIGN,
};
enum number_format_base {
B_DEFAULT_BASE = -1, // locale default, usually decimal, but
// may be something like roman as well
B_FLEXIBLE_DECIMAL_BASE = 0, // same as B_DECIMAL_BASE when formatting,
// but recognizes octal and hexadecimal
// numbers by prefix when parsing
B_OCTAL_BASE = 8,
B_DECIMAL_BASE = 10,
B_HEXADECIMAL_BASE = 16,
};
class BNumberFormatParameters : public BFormatParameters {
public:
BNumberFormatParameters(const BNumberFormatParameters *parent = NULL);
BNumberFormatParameters(const BNumberFormatParameters &other);
~BNumberFormatParameters();
void SetUseGrouping(bool useGrouping);
bool UseGrouping() const;
void SetSignPolicy(number_format_sign_policy policy);
number_format_sign_policy SignPolicy() const;
void SetBase(number_format_base base);
number_format_base Base() const;
void SetUseBasePrefix(bool useBasePrefix);
bool UseBasePrefix() const;
void SetMinimalIntegerDigits(size_t minIntegerDigits);
size_t MinimalIntegerDigits() const;
void SetUseZeroPadding(bool zeroPadding);
bool UseZeroPadding() const;
const BNumberFormatParameters *ParentNumberParameters() const;
BNumberFormatParameters &operator=(
const BNumberFormatParameters &other);
protected:
void SetParentNumberParameters(const BNumberFormatParameters *parent);
private:
const BNumberFormatParameters *fParent;
bool fUseGrouping;
number_format_sign_policy fSignPolicy;
number_format_base fBase;
bool fUseBasePrefix;
size_t fMinimalIntegerDigits;
bool fUseZeroPadding;
uint32 fFlags;
};
#endif // _B_NUMBER_FORMAT_PARAMETERS_H_

View File

@ -1,12 +0,0 @@
#include <FormatImpl.h>
// constructor
BFormatImpl::BFormatImpl()
{
}
// destructor
BFormatImpl::~BFormatImpl()
{
}

View File

@ -1,96 +0,0 @@
#include <FormatParameters.h>
// defaults
static const format_alignment kDefaultAlignment = B_ALIGN_FORMAT_RIGHT;
static const size_t kDefaultFormatWidth = 1;
// flags
enum {
ALIGNMENT_SET = 0x01,
WIDTH_SET = 0x02,
};
// constructor
BFormatParameters::BFormatParameters(const BFormatParameters *parent)
: fParent(parent),
fFlags(0)
{
}
// copy constructor
BFormatParameters::BFormatParameters(const BFormatParameters &other)
: fParent(other.fParent),
fAlignment(other.fAlignment),
fWidth(other.fWidth),
fFlags(other.fFlags)
{
}
// destructor
BFormatParameters::~BFormatParameters()
{
}
// SetAlignment
void
BFormatParameters::SetAlignment(format_alignment alignment)
{
fAlignment = alignment;
fFlags |= ALIGNMENT_SET;
}
// Alignment
format_alignment
BFormatParameters::Alignment() const
{
if (fFlags & ALIGNMENT_SET)
return fAlignment;
if (fParent)
return fParent->Alignment();
return kDefaultAlignment;
}
// SetFormatWidth
void
BFormatParameters::SetFormatWidth(size_t width)
{
fWidth = width;
fFlags |= WIDTH_SET;
}
// FormatWidth
size_t
BFormatParameters::FormatWidth() const
{
if (fFlags & WIDTH_SET)
return fWidth;
if (fParent)
return fParent->FormatWidth();
return kDefaultFormatWidth;
}
// SetParentParameters
void
BFormatParameters::SetParentParameters(const BFormatParameters *parent)
{
fParent = parent;
}
// ParentParameters
const BFormatParameters *
BFormatParameters::ParentParameters() const
{
return fParent;
}
// =
BFormatParameters &
BFormatParameters::operator=(const BFormatParameters &other)
{
fParent = other.fParent;
fAlignment = other.fAlignment;
fWidth = other.fWidth;
fFlags = other.fFlags;
return *this;
}

View File

@ -34,11 +34,6 @@ local sources =
TimeUnitFormat.cpp
Format.cpp # Used by some of the above.
UnicodeChar.cpp # Already used in FirstBootPrompt.
# old, needs investigation
# FormatImpl.cpp
# FormatParameters.cpp
# NumberFormatParameters.cpp
;
local architectureObject ;

View File

@ -1,195 +0,0 @@
#include <NumberFormatParameters.h>
// defaults
static const bool kDefaultUseGrouping = false;
static const number_format_sign_policy kDefaultSignPolicy
= B_USE_NEGATIVE_SIGN_ONLY;
static const number_format_base kDefaultBase = B_DEFAULT_BASE;
static const bool kDefaultUseBasePrefix = false;
static const size_t kDefaultMinimalIntegerDigits = 1;
static const bool kDefaultUseZeroPadding = false;
// flags
enum {
USE_GROUPING_SET = 0x01,
SIGN_POLICY_SET = 0x02,
BASE_SET = 0x04,
USE_BASE_PREFIX_SET = 0x08,
MINIMAL_INTEGER_DIGITS_SET = 0x10,
USE_ZERO_PADDING_SET = 0x20,
};
// constructor
BNumberFormatParameters::BNumberFormatParameters(
const BNumberFormatParameters *parent)
: BFormatParameters(parent),
fParent(parent),
fFlags(0)
{
}
// copy constructor
BNumberFormatParameters::BNumberFormatParameters(
const BNumberFormatParameters &other)
: BFormatParameters(other),
fParent(other.fParent),
fUseGrouping(other.fUseGrouping),
fSignPolicy(other.fSignPolicy),
fBase(other.fBase),
fUseBasePrefix(other.fUseBasePrefix),
fMinimalIntegerDigits(other.fMinimalIntegerDigits),
fFlags(other.fFlags)
{
}
// destructor
BNumberFormatParameters::~BNumberFormatParameters()
{
}
// SetUseGrouping
void
BNumberFormatParameters::SetUseGrouping(bool useGrouping)
{
fUseGrouping = useGrouping;
fFlags |= USE_GROUPING_SET;
}
// UseGrouping
bool
BNumberFormatParameters::UseGrouping() const
{
if (fFlags & USE_GROUPING_SET)
return fUseGrouping;
if (fParent)
return fParent->UseGrouping();
return kDefaultUseGrouping;
}
// SetSignPolicy
void
BNumberFormatParameters::SetSignPolicy(number_format_sign_policy policy)
{
fSignPolicy = policy;
fFlags |= SIGN_POLICY_SET;
}
// SignPolicy
number_format_sign_policy
BNumberFormatParameters::SignPolicy() const
{
if (fFlags & SIGN_POLICY_SET)
return fSignPolicy;
if (fParent)
return fParent->SignPolicy();
return kDefaultSignPolicy;
}
// SetBase
void
BNumberFormatParameters::SetBase(number_format_base base)
{
fBase = base;
fFlags |= BASE_SET;
}
// Base
number_format_base
BNumberFormatParameters::Base() const
{
if (fFlags & BASE_SET)
return fBase;
if (fParent)
return fParent->Base();
return kDefaultBase;
}
// SetUseBasePrefix
void
BNumberFormatParameters::SetUseBasePrefix(bool useBasePrefix)
{
fUseBasePrefix = useBasePrefix;
fFlags |= USE_BASE_PREFIX_SET;
}
// UseBasePrefix
bool
BNumberFormatParameters::UseBasePrefix() const
{
if (fFlags & USE_BASE_PREFIX_SET)
return fUseBasePrefix;
if (fParent)
return fParent->UseBasePrefix();
return kDefaultUseBasePrefix;
}
// SetMinimalIntegerDigits
void
BNumberFormatParameters::SetMinimalIntegerDigits(size_t minIntegerDigits)
{
fMinimalIntegerDigits = minIntegerDigits;
fFlags |= MINIMAL_INTEGER_DIGITS_SET;
}
// MinimalIntegerDigits
size_t
BNumberFormatParameters::MinimalIntegerDigits() const
{
if (fFlags & MINIMAL_INTEGER_DIGITS_SET)
return fMinimalIntegerDigits;
if (fParent)
return fParent->MinimalIntegerDigits();
return kDefaultMinimalIntegerDigits;
}
// SetUseZeroPadding
void
BNumberFormatParameters::SetUseZeroPadding(bool useZeroPadding)
{
fUseZeroPadding = useZeroPadding;
fFlags |= USE_ZERO_PADDING_SET;
}
// UseZeroPadding
bool
BNumberFormatParameters::UseZeroPadding() const
{
if (fFlags & USE_ZERO_PADDING_SET)
return fUseZeroPadding;
if (fParent)
return fParent->UseZeroPadding();
return kDefaultUseZeroPadding;
}
// SetParentNumberParameters
void
BNumberFormatParameters::SetParentNumberParameters(
const BNumberFormatParameters *parent)
{
fParent = parent;
SetParentParameters(parent);
}
// ParentNumberParameters
const BNumberFormatParameters *
BNumberFormatParameters::ParentNumberParameters() const
{
return fParent;
}
// =
BNumberFormatParameters &
BNumberFormatParameters::operator=(const BNumberFormatParameters &other)
{
BFormatParameters::operator=(other);
fParent = other.fParent;
fUseGrouping = other.fUseGrouping;
fSignPolicy = other.fSignPolicy;
fBase = other.fBase;
fUseBasePrefix = other.fUseBasePrefix;
fMinimalIntegerDigits = other.fMinimalIntegerDigits;
fFlags = other.fFlags;
fUseZeroPadding = other.fUseZeroPadding;
return *this;
}