vfs: check userland buffers before reading them.
[haiku.git] / headers / os / locale / DurationFormat.h
blob3db8203f7596ef273a86d20c04c7a9d0525b9ef7
1 /*
2 * Copyright 2010-2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _B_DURATION_FORMAT_H_
6 #define _B_DURATION_FORMAT_H_
9 #include <Format.h>
10 #include <Locale.h>
11 #include <String.h>
12 #include <TimeUnitFormat.h>
15 class BTimeZone;
17 #ifndef U_ICU_NAMESPACE
18 #define U_ICU_NAMESPACE icu
19 #endif
20 namespace U_ICU_NAMESPACE {
21 class GregorianCalendar;
25 class BDurationFormat : public BFormat {
26 typedef BFormat Inherited;
28 public:
29 BDurationFormat(const BLanguage& language,
30 const BFormattingConventions& conventions,
31 const BString& separator = ", ",
32 const time_unit_style style = B_TIME_UNIT_FULL);
33 BDurationFormat(const BString& separator = ", ",
34 const time_unit_style style = B_TIME_UNIT_FULL);
35 BDurationFormat(const BDurationFormat& other);
36 virtual ~BDurationFormat();
38 void SetSeparator(const BString& separator);
39 status_t SetTimeZone(const BTimeZone* timeZone);
41 status_t Format(BString& buffer,
42 const bigtime_t startValue,
43 const bigtime_t stopValue) const;
45 private:
46 BString fSeparator;
47 BTimeUnitFormat fTimeUnitFormat;
48 U_ICU_NAMESPACE::GregorianCalendar* fCalendar;
52 #endif