1 /* 2 * Copyright 2003-2010, Haiku, Inc. 3 * Distributed under the terms of the MIT Licence. 4 */ 5 #ifndef _B_FORMAT_H_ 6 #define _B_FORMAT_H_ 7 8 #include <FormatParameters.h> 9 #include <SupportDefs.h> 10 11 12 // types of fields contained in formatted strings 13 enum { 14 // number format fields 15 B_CURRENCY_FIELD, 16 B_DECIMAL_SEPARATOR_FIELD, 17 B_EXPONENT_FIELD, 18 B_EXPONENT_SIGN_FIELD, 19 B_EXPONENT_SYMBOL_FIELD, 20 B_FRACTION_FIELD, 21 B_GROUPING_SEPARATOR_FIELD, 22 B_INTEGER_FIELD, 23 B_PERCENT_FIELD, 24 B_PERMILLE_FIELD, 25 B_SIGN_FIELD, 26 27 // date format fields 28 // TODO: ... 29 }; 30 31 // structure filled in while formatting 32 struct format_field_position { 33 uint32 field_type; 34 int32 start; 35 int32 length; 36 }; 37 38 39 class BLocale; 40 41 class BFormat { 42 public: 43 status_t InitCheck() const; 44 45 virtual status_t SetLocale(const BLocale* locale); 46 protected: 47 BFormat(); 48 BFormat(const BFormat& other); 49 virtual ~BFormat(); 50 51 BFormat& operator=(const BFormat& other); 52 53 status_t fInitStatus; 54 BLocale* fLocale; 55 }; 56 57 58 #endif // _B_FORMAT_H_ 59