* BCountry : use lazy initialisation for the date and time formatters, since they are not always used. Makes instancaiating a country faster, and

so, loading the locale preflet is also faster and use less memory.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37696 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2010-07-22 13:54:53 +00:00
parent 80e6909dd1
commit 3bdfd7f340
2 changed files with 111 additions and 68 deletions
+5 -2
View File
@@ -68,12 +68,12 @@ class BCountry {
status_t DateFields(BDateElement*& fields, int& fieldCount,
bool longFormat);
bool DateFormat(BString&, bool longFormat) const;
bool DateFormat(BString&, bool longFormat);
void SetDateFormat(const char* formatString,
bool longFormat = true);
void SetTimeFormat(const char* formatString,
bool longFormat = true);
bool TimeFormat(BString&, bool longFormat) const;
bool TimeFormat(BString&, bool longFormat);
int StartOfWeek();
@@ -112,6 +112,9 @@ class BCountry {
status_t GetTimeZones(BMessage* timezones);
private:
icu_44::DateFormat* DateFormatter(bool longFormat);
icu_44::DateFormat* TimeFormatter(bool longFormat);
icu_44::DateFormat* fICULongDateFormatter;
icu_44::DateFormat* fICUShortDateFormatter;
icu_44::DateFormat* fICULongTimeFormatter;