xref: /haiku/docs/user/locale/DurationFormat.dox (revision 4466b89c65970de4c7236ac87faa2bee4589f413)
1/*
2 * Copyright 2011, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Adrien Destugues, pulkomandy@pulkomandy.ath.cx
7 *
8 * Corresponds to:
9 *		/trunk/headers/os/locale/DurationFormat.h	 rev 42944
10 *		/trunk/src/kits/locale/DurationFormat.cpp	 rev 42944
11 */
12
13
14/*!
15  \class BDurationFormat
16  \ingroup locale
17  \brief Formatter for time interfals
18
19  BDurationFormat is a formatter for time intervals. A time interval is defined
20  by its start and end values, and the result is a string such as
21  "1 hour, 2 minutes, 28 seconds".
22*/
23
24
25/*!
26  \fn BDurationFormat::BDurationFormat(const BString& separator)
27  \brief Constructor.
28
29  \warning Creating a BDurationFormat is a costly operation. Most of the time,
30  you most likely want to use the default one through the BLocale class.
31
32  The separator string will be appended between the elements of formated
33  durations.
34*/
35
36
37/*!
38  \fn void BDurationFormat::SetSeparator(cosnt BString& separator)
39  \brief Replace the spearator for this formatter.
40*/
41
42
43/*!
44  \fn status_t BDurationForamt::SetLocale(const BLocale* locale)
45  \brief Sets the locale for this formatter.
46*/
47
48
49/*!
50  \fn status_t BDurationFormat::Format(bigtime_t startValue,
51  	bigtime_t endValue, BString* buffer, time_unit_style = B_TIME_UNIT_FULL)
52	const;
53  \brief Formats a duration defined by its start and end values.
54
55The start and end values are in milliseconds. The result is appeded to the
56buffer. The full time style uses full words (hours, minuts, seconds), while the
57shot one uses units (h, m, s).
58*/
59