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