haiku/headers/os/locale/DurationFormat.h
Jérôme Duval 73de58376a Update icu x86_64 package with namespace renaming enabled.
"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.
2015-05-10 21:52:36 +02:00

54 lines
1.2 KiB
C++

/*
* Copyright 2010-2011, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _B_DURATION_FORMAT_H_
#define _B_DURATION_FORMAT_H_
#include <Format.h>
#include <Locale.h>
#include <String.h>
#include <TimeUnitFormat.h>
class BTimeZone;
#ifndef U_ICU_NAMESPACE
#define U_ICU_NAMESPACE icu
#endif
namespace U_ICU_NAMESPACE {
class GregorianCalendar;
}
class BDurationFormat : public BFormat {
typedef BFormat Inherited;
public:
BDurationFormat(const BLanguage& language,
const BFormattingConventions& conventions,
const BString& separator = ", ");
BDurationFormat(
const BString& separator = ", ");
BDurationFormat(const BDurationFormat& other);
virtual ~BDurationFormat();
void SetSeparator(const BString& separator);
status_t SetTimeZone(const BTimeZone* timeZone);
status_t Format(BString& buffer,
const bigtime_t startValue,
const bigtime_t stopValue,
time_unit_style style = B_TIME_UNIT_FULL
) const;
private:
BString fSeparator;
BTimeUnitFormat fTimeUnitFormat;
U_ICU_NAMESPACE::GregorianCalendar* fCalendar;
};
#endif