From 279125fbd9daa72ad94bf43ce64c22ed12a48416 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 29 Aug 2010 20:52:28 +0000 Subject: [PATCH] * added BTimeZone::Accessor class, which allows other LocaleKit classes to access a BTimeZone's ICU-timeZone git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38427 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/locale/TimeZone.h | 2 ++ headers/private/locale/TimeZoneAccessor.h | 31 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 headers/private/locale/TimeZoneAccessor.h diff --git a/headers/os/locale/TimeZone.h b/headers/os/locale/TimeZone.h index d20c0ce913..5e609d875f 100644 --- a/headers/os/locale/TimeZone.h +++ b/headers/os/locale/TimeZone.h @@ -42,6 +42,8 @@ public: static const char* kNameOfGmtZone; + struct Accessor; + friend struct BTimeZone::Accessor; private: icu_44::TimeZone* fIcuTimeZone; icu_44::Locale* fIcuLocale; diff --git a/headers/private/locale/TimeZoneAccessor.h b/headers/private/locale/TimeZoneAccessor.h new file mode 100644 index 0000000000..f968f5eb5c --- /dev/null +++ b/headers/private/locale/TimeZoneAccessor.h @@ -0,0 +1,31 @@ +/* + * Copyright 2010, Oliver Tappe + * Distributed under the terms of the MIT License. + */ +#ifndef _TIME_ZONE_ACCESSOR_H +#define _TIME_ZONE_ACCESSOR_H + + +#include + + +struct BTimeZone::Accessor { + Accessor(const BTimeZone* timeZone = NULL) + : fTimeZone(timeZone) + {} + + void SetTo(const BTimeZone* timeZone) + { + fTimeZone = timeZone; + } + + icu_44::TimeZone* IcuTimeZone() + { + return fTimeZone->fIcuTimeZone; + } + + const BTimeZone* fTimeZone; +}; + + +#endif // _TIME_ZONE_ACCESSOR_H