Fix FreeBSD build.
[haiku.git] / headers / os / locale / TimeFormat.h
blob152b872f8b48d28552be2c9ce8e710fcf0a02421
1 /*
2 * Copyright 2010-2014, Haiku, Inc.
3 * Distributed under the terms of the MIT Licence.
4 */
5 #ifndef _B_TIME_FORMAT_H_
6 #define _B_TIME_FORMAT_H_
9 #include <DateTimeFormat.h>
12 class BString;
14 namespace BPrivate {
15 class BTime;
19 class BTimeFormat : public BFormat {
20 public:
21 BTimeFormat();
22 BTimeFormat(const BLanguage& language,
23 const BFormattingConventions& conventions);
24 BTimeFormat(const BTimeFormat &other);
25 virtual ~BTimeFormat();
27 void SetTimeFormat(BTimeFormatStyle style,
28 const BString& format);
30 // formatting
32 ssize_t Format(char* string, size_t maxSize,
33 time_t time, BTimeFormatStyle style) const;
34 status_t Format(BString& string, const time_t time,
35 const BTimeFormatStyle style,
36 const BTimeZone* timeZone = NULL) const;
37 status_t Format(BString& string,
38 int*& fieldPositions, int& fieldCount,
39 time_t time, BTimeFormatStyle style) const;
41 status_t GetTimeFields(BDateElement*& fields,
42 int& fieldCount, BTimeFormatStyle style
43 ) const;
45 // parsing
47 status_t Parse(BString source, BTimeFormatStyle style,
48 BPrivate::BTime& output);
50 private:
51 U_ICU_NAMESPACE::DateFormat* _CreateTimeFormatter(
52 const BTimeFormatStyle style) const;
56 #endif // _B_TIME_FORMAT_H_