[haiku-commits] r38427 - in haiku/trunk/headers: os/locale private/locale

  • From: zooey@xxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 29 Aug 2010 22:52:28 +0200 (CEST)

Author: zooey
Date: 2010-08-29 22:52:28 +0200 (Sun, 29 Aug 2010)
New Revision: 38427
Changeset: http://dev.haiku-os.org/changeset/38427

Added:
   haiku/trunk/headers/private/locale/TimeZoneAccessor.h
Modified:
   haiku/trunk/headers/os/locale/TimeZone.h
Log:
* added BTimeZone::Accessor class, which allows other LocaleKit classes to
  access a BTimeZone's ICU-timeZone 

Modified: haiku/trunk/headers/os/locale/TimeZone.h
===================================================================
--- haiku/trunk/headers/os/locale/TimeZone.h    2010-08-29 20:40:15 UTC (rev 
38426)
+++ haiku/trunk/headers/os/locale/TimeZone.h    2010-08-29 20:52:28 UTC (rev 
38427)
@@ -42,6 +42,8 @@
 
        static  const char*                     kNameOfGmtZone;
 
+                       struct Accessor;
+       friend  struct BTimeZone::Accessor;
 private:
                        icu_44::TimeZone*       fIcuTimeZone;
                        icu_44::Locale*         fIcuLocale;

Added: haiku/trunk/headers/private/locale/TimeZoneAccessor.h
===================================================================
--- haiku/trunk/headers/private/locale/TimeZoneAccessor.h                       
        (rev 0)
+++ haiku/trunk/headers/private/locale/TimeZoneAccessor.h       2010-08-29 
20:52:28 UTC (rev 38427)
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2010, Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _TIME_ZONE_ACCESSOR_H
+#define _TIME_ZONE_ACCESSOR_H
+
+
+#include <TimeZone.h>
+
+
+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


Other related posts: