a9faf94392
values * added locking to BLocale (needed since the data of the global object may change any time) * BLocale no longer passes out pointers to internal objects, it fill objects passed in by the client instead (just like be_locale_roster does) * dropped default language as member from RosterData, it is no part of the default locale * fleshed out implementation of TimeUnitFormat and DurationFormat, both of which can now be given a BLocale in order to set the strings being used during formatting git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38428 a95241bf-73f2-0310-859d-f6bbb57e9c96
59 lines
1.0 KiB
C++
59 lines
1.0 KiB
C++
/*
|
|
* Copyright 2003-2010, Haiku, Inc.
|
|
* Distributed under the terms of the MIT Licence.
|
|
*/
|
|
#ifndef _B_FORMAT_H_
|
|
#define _B_FORMAT_H_
|
|
|
|
#include <FormatParameters.h>
|
|
#include <SupportDefs.h>
|
|
|
|
|
|
// types of fields contained in formatted strings
|
|
enum {
|
|
// number format fields
|
|
B_CURRENCY_FIELD,
|
|
B_DECIMAL_SEPARATOR_FIELD,
|
|
B_EXPONENT_FIELD,
|
|
B_EXPONENT_SIGN_FIELD,
|
|
B_EXPONENT_SYMBOL_FIELD,
|
|
B_FRACTION_FIELD,
|
|
B_GROUPING_SEPARATOR_FIELD,
|
|
B_INTEGER_FIELD,
|
|
B_PERCENT_FIELD,
|
|
B_PERMILLE_FIELD,
|
|
B_SIGN_FIELD,
|
|
|
|
// date format fields
|
|
// TODO: ...
|
|
};
|
|
|
|
// structure filled in while formatting
|
|
struct format_field_position {
|
|
uint32 field_type;
|
|
int32 start;
|
|
int32 length;
|
|
};
|
|
|
|
|
|
class BLocale;
|
|
|
|
class BFormat {
|
|
public:
|
|
status_t InitCheck() const;
|
|
|
|
virtual status_t SetLocale(const BLocale* locale);
|
|
protected:
|
|
BFormat();
|
|
BFormat(const BFormat& other);
|
|
virtual ~BFormat();
|
|
|
|
BFormat& operator=(const BFormat& other);
|
|
|
|
status_t fInitStatus;
|
|
BLocale* fLocale;
|
|
};
|
|
|
|
|
|
#endif // _B_FORMAT_H_
|