2010-08-02 00:28:19 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2003-2010, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT Licence.
|
|
|
|
*/
|
2009-05-01 23:23:59 +04:00
|
|
|
#ifndef _B_FORMAT_H_
|
|
|
|
#define _B_FORMAT_H_
|
|
|
|
|
|
|
|
#include <FormatParameters.h>
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
// 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
|
2009-05-02 01:56:16 +04:00
|
|
|
struct format_field_position {
|
2009-05-01 23:23:59 +04:00
|
|
|
uint32 field_type;
|
|
|
|
int32 start;
|
|
|
|
int32 length;
|
|
|
|
};
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
|
2010-08-30 00:55:00 +04:00
|
|
|
class BLocale;
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2009-05-02 01:56:16 +04:00
|
|
|
class BFormat {
|
2010-08-30 00:55:00 +04:00
|
|
|
public:
|
|
|
|
status_t InitCheck() const;
|
|
|
|
|
|
|
|
virtual status_t SetLocale(const BLocale* locale);
|
2010-08-02 00:28:19 +04:00
|
|
|
protected:
|
2010-08-30 00:55:00 +04:00
|
|
|
BFormat();
|
2010-08-02 00:28:19 +04:00
|
|
|
BFormat(const BFormat& other);
|
|
|
|
virtual ~BFormat();
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
BFormat& operator=(const BFormat& other);
|
2009-05-01 23:23:59 +04:00
|
|
|
|
2010-08-30 00:55:00 +04:00
|
|
|
status_t fInitStatus;
|
|
|
|
BLocale* fLocale;
|
2009-05-01 23:23:59 +04:00
|
|
|
};
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
|
2009-05-01 23:23:59 +04:00
|
|
|
#endif // _B_FORMAT_H_
|