73de58376a
"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.
57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
/*
|
|
* Copyright 2010-2014, Haiku, Inc.
|
|
* Distributed under the terms of the MIT Licence.
|
|
*/
|
|
#ifndef _B_TIME_FORMAT_H_
|
|
#define _B_TIME_FORMAT_H_
|
|
|
|
|
|
#include <DateTimeFormat.h>
|
|
|
|
|
|
class BString;
|
|
|
|
namespace BPrivate {
|
|
class BTime;
|
|
}
|
|
|
|
|
|
class BTimeFormat : public BFormat {
|
|
public:
|
|
BTimeFormat();
|
|
BTimeFormat(const BLanguage& language,
|
|
const BFormattingConventions& conventions);
|
|
BTimeFormat(const BTimeFormat &other);
|
|
virtual ~BTimeFormat();
|
|
|
|
void SetTimeFormat(BTimeFormatStyle style,
|
|
const BString& format);
|
|
|
|
// formatting
|
|
|
|
ssize_t Format(char* string, size_t maxSize,
|
|
time_t time, BTimeFormatStyle style) const;
|
|
status_t Format(BString& string, const time_t time,
|
|
const BTimeFormatStyle style,
|
|
const BTimeZone* timeZone = NULL) const;
|
|
status_t Format(BString& string,
|
|
int*& fieldPositions, int& fieldCount,
|
|
time_t time, BTimeFormatStyle style) const;
|
|
|
|
status_t GetTimeFields(BDateElement*& fields,
|
|
int& fieldCount, BTimeFormatStyle style
|
|
) const;
|
|
|
|
// parsing
|
|
|
|
status_t Parse(BString source, BTimeFormatStyle style,
|
|
BPrivate::BTime& output);
|
|
|
|
private:
|
|
U_ICU_NAMESPACE::DateFormat* _CreateTimeFormatter(
|
|
const BTimeFormatStyle style) const;
|
|
};
|
|
|
|
|
|
#endif // _B_TIME_FORMAT_H_
|