Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_TimeZone Class Reference

Inheritance diagram for CP_TimeZone:

CP_Object CP_M_RefCounted CP_CFObject< CFTimeZoneRef > CP_NoCopy List of all members.

Public Member Functions

bool IsDaylightSavingTime (const CP_DateTime &inDate) const
CP_String GetName () const
CP_String GetAbbreviation (const CP_DateTime &inDate) const
SInt32 GetSecondsFromGMT (const CP_DateTime &inDate) const
 CP_TimeZone (CFTimeZoneRef inTimeZoneRef, bool inRetain)
bool IsDaylightSavingTime (const SYSTEMTIME &inDate) const
SInt32 GetSecondsFromGMT (const SYSTEMTIME &inDate) const
 CP_TimeZone ()
void SetID (FourCharCode inIdentifier)
FourCharCode GetID ()
void RegisterSignal (const CP_SignalHolder &inSignal)
CP_DataValueSignalFindSignal (const CP_String &inSignalName)
UInt32 GetNumberSignals ()
CP_String GetNthSignalName (UInt32 inSignalIndex)
void RegisterSlot (const CP_SlotHolder &inSlot)
CP_DataValueSlot FindSlot (const CP_String &inSlotName)
UInt32 GetNumberSlots ()
CP_String GetNthSlotName (UInt32 inSlotIndex)
template<class R, class P1, class P2>
CP_CommandHandlerSignalConnect (CPLAT::CP_CommandNo cmd, void(R::*handler)(P1, P2), SInt32 mode)
template<class R, class P1, class P2>
void Connect (CP_Object *control, const CPLAT::CP_String &signalName, void(R::*handler)(P1, P2))
void AttachRef (CFTimeZoneRefinRef, bool inRetain)
CFTimeZoneRef DetachRef ()
CFTimeZoneRef GetCFRef () const
bool IsValid () const
Constructor / Destructor
 CP_TimeZone (const CP_String &inName, bool inSearchAbbrev)
 CP_TimeZone (SInt32 inSecondsFromGMT, const CP_String &inName)
virtual ~CP_TimeZone () throw ()
 Destructor.

Static Public Member Functions

static void GetKnownNames (std::vector< CP_String > &outAllNames)
static void SetDefaultZone (const CP_TimeZone *inDefaultZone)
static void Connect (CP_Object *sender, const CP_String &signalName, CP_Object *receiver, const CP_String &slotName, const bool reciprocal=false)
static void Connect (CP_Object *sender, CP_Object *receiver, const bool reciprocal=false, const CP_String &signalName=kCP_Signal_ValueChanged, const CP_String &slotName=kCP_Slot_SetValue)
Accessing Shared Timezones
static const CP_TimeZoneDefaultZone ()
static const CP_TimeZoneSystemZone ()
static const CP_TimeZoneGMTZone ()

Protected Attributes

CP_Signals_ArrayfSignals
CP_Slots_ArrayfSlots
FourCharCode fObjectID
CFTimeZoneRef fCFObject

Static Protected Attributes

static FourCharCode fObjectIDCount = 0

Private Attributes

TIME_ZONE_INFORMATION fTimeZoneInfo

Static Private Attributes

static CP_SmartRef< const
CP_TimeZone
gDefaultZone
static std::map< CP_String,
TIME_ZONE_INFORMATION > 
gRegisteredZones
static bool gRegisteredZonesInitialized = false

Detailed Description

A class holding information about a speific time zone.
See also:
CP_DateTime


Constructor & Destructor Documentation

CP_TimeZone::CP_TimeZone const CP_String inName,
bool  inSearchAbbrev
 

Constructs a timezone by looking up the timezone data using the specified name which represents a geographical location or abbreviation.

See also:
CP_TimeZone::GetKnownNames
Exceptions:
std::invalid_argument raised if no time zone with the given name could be found.
Parameters:
inName The name of the geographical location or an abbreviation of a timezone name.
inSearchAbbrev If true, tries to resolve inName using the list of known abbreviations before looking for a zone with matching name. If false, it only looks for matching names.

CP_TimeZone::CP_TimeZone SInt32  inSecondsFromGMT,
const CP_String inName
 

Construct a custom timezone with the specified GMT (Greenwich Mean Time) offset.

Note:
The new timezone won't be found using CP_TimeZone(const CP_String&, bool) even when passing the same name as the name is not registered as a known location.
Also, this time zone will never take into account daylight saving time, as it doesn't know about the rules.
Exceptions:
none. 
Parameters:
inSecondsFromGMT Time offset from GMT in seconds (negativ numbers indicate timezone is behind GMT).
inName The name for the custom timezone.

CP_TimeZone::~CP_TimeZone  )  throw () [virtual]
 

CP_TimeZone::CP_TimeZone CFTimeZoneRef  inTimeZoneRef,
bool  inRetain
 

CP_TimeZone::CP_TimeZone  ) 
 

Constructs a CP_TimeZone based on the current system settings

Note:
Available only on Windows


Member Function Documentation

const CP_TimeZone * CP_TimeZone::DefaultZone  )  [static]
 

Returns the default user time zone. Defaults to the system time zone unless the user set it something else using CP_TimeZone::SetDefaultZone().

Exceptions:
none 
Returns:
CP_TimeZone* A pointer to the default user time zone.

const CP_TimeZone * CP_TimeZone::SystemZone  )  [static]
 

Returns the time zone currently used by the system.

Exceptions:
none 
Returns:
CP_TimeZone* A pointer to the time zone currently used by the system.

const CP_TimeZone * CP_TimeZone::GMTZone  )  [static]
 

Returns the GMT (Greenwich Mean Time) time zone.

Exceptions:
none 
Returns:
CP_TimeZone* A pointer to the time zone representing GMT.

bool CP_TimeZone::IsDaylightSavingTime const CP_DateTime inDate  )  const
 

Returns whether daylight saving time was active at the specified date.

Exceptions:
none 
Returns:
bool Was daylight saving time in action at the specified date?

CP_String CP_TimeZone::GetName  )  const
 

Returns the time zone's name, which is usually the geographical region name for the standard time zones or the custom name supplied in the constructor for custom timezones.

Exceptions:
none 
Returns:
CP_String The time zone's name.

CP_String CP_TimeZone::GetAbbreviation const CP_DateTime inDate  )  const
 

Returns the time zone's abbreviation at the specified date.

Note:
The abbreviation may be different at different dates. For example, during daylight savings time the US/Eastern time zone has an abbreviation of "EDT." At other times, its abbreviation is "EST."
Exceptions:
none 
Returns:
CP_String The time zone's abbreviation at the specified date.

SInt32 CP_TimeZone::GetSecondsFromGMT const CP_DateTime inDate  )  const
 

Returns the difference between the time zone and GMT (Greenwich Mean Time) at the specified date.

Exceptions:
none 
Returns:
SInt32 The time difference between the time zone and GMT in seconds.

void CP_TimeZone::GetKnownNames std::vector< CP_String > &  outAllNames  )  [static]
 

Returns a list of known timezone names.

Exceptions:
none 
Parameters:
[out] outAllNames A vector of strings that will contain the names on exit.

void CP_TimeZone::SetDefaultZone const CP_TimeZone inDefaultZone  )  [static]
 

Sets the default user time zone. This is the time zone returned by CP_TimeZone::DefaultZone().

Exceptions:
none 
Parameters:
inDefaultZone A pointer to a time zone object to use as the default zone, or NULL to use the system time zone.

bool CP_TimeZone::IsDaylightSavingTime const SYSTEMTIME &  inDate  )  const
 

SInt32 CP_TimeZone::GetSecondsFromGMT const SYSTEMTIME &  inDate  )  const
 

void CP_Object::SetID FourCharCode  inIdentifier  )  [inherited]
 

Sets the identifier for this object. If a specific identifier is not set with this function, then a default id is used, which is simply a running count of the number of objects created.

Parameters:
inIdentifier The objects identifier.
Returns:
void

FourCharCode CP_Object::GetID  )  [inherited]
 

Returns the objects identifier.

Returns:
FourCharCode The identifier of this object.

void CP_Object::RegisterSignal const CP_SignalHolder inSignal  )  [inherited]
 

Registers the signal / signal name contained in the passed in inSignal object.

Parameters:
inSignal CP_SignalHolder that holds a signal and string identifier.
Returns:
void

CP_DataValueSignal * CP_Object::FindSignal const CP_String inSignalName  )  [inherited]
 

Finds the CP_DataValueSignal object that matches the passed in inSignalName.

Parameters:
inSignalName CP_String containing the identifier of the signal to return.
Returns:
CP_DataValueSignal * Returns a pointer to a CP_DataValueSignal object.

UInt32 CP_Object::GetNumberSignals  )  [inherited]
 

Returns the number of signals for this object.

Returns:
UInt32 The number of signals.

CP_String CP_Object::GetNthSignalName UInt32  inSignalIndex  )  [inherited]
 

Returns the signal name of the passed in signal index.

Parameters:
inSignalIndex Index of the name of the signal to return.
Returns:
CP_String The name of the nth signal being returned.

void CP_Object::RegisterSlot const CP_SlotHolder inSlot  )  [inherited]
 

Registers the slot / slot name contained in the passed in inSlot object.

Parameters:
inSlot CP_SignalHolder that holds a slot and string identifier.
Returns:
void

CP_DataValueSlot CP_Object::FindSlot const CP_String inSlotName  )  [inherited]
 

Finds the CP_Slot1 object that matches the passed in inSlotName.

Parameters:
inSlotName CP_String containing the identifier of the slot to return.
Returns:
CP_DataValueSlot Returns a pointer to a CP_DataValueSlot object.

UInt32 CP_Object::GetNumberSlots  )  [inherited]
 

Returns the number of slots for this object.

Returns:
UInt32 The number of slots.

CP_String CP_Object::GetNthSlotName UInt32  inSlotIndex  )  [inherited]
 

Returns the slot name of the passed in signal index.

Parameters:
inSlotIndex Index of the name of the slot to return.
Returns:
CP_String The name of the nth slot being returned.

template<class R, class P1, class P2>
CP_CommandHandlerSignal* CP_Object::Connect CPLAT::CP_CommandNo  cmd,
void(R::*)(P1, P2)  handler,
SInt32  mode
[inherited]
 

template<class R, class P1, class P2>
void CP_Object::Connect CP_Object control,
const CPLAT::CP_String &  signalName,
void(R::*)(P1, P2)  handler
[inherited]
 

void CP_Object::Connect CP_Object sender,
const CP_String signalName,
CP_Object receiver,
const CP_String slotName,
const bool  reciprocal = false
[static, inherited]
 

void CP_Object::Connect CP_Object sender,
CP_Object receiver,
const bool  reciprocal = false,
const CP_String signalName = kCP_Signal_ValueChanged,
const CP_String slotName = kCP_Slot_SetValue
[static, inherited]
 

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.

void CP_CFObject< CFTimeZoneRef >::AttachRef CFTimeZoneRef   inRef,
bool  inRetain
[inherited]
 

CFTimeZoneRef CP_CFObject< CFTimeZoneRef >::DetachRef  )  [inherited]
 

CFTimeZoneRef CP_CFObject< CFTimeZoneRef >::GetCFRef  )  const [inherited]
 

bool CP_CFObject< CFTimeZoneRef >::IsValid  )  const [inherited]
 


Member Data Documentation

CP_SmartRef< const CP_TimeZone > CP_TimeZone::gDefaultZone [static, private]
 

TIME_ZONE_INFORMATION CP_TimeZone::fTimeZoneInfo [private]
 

std::map< CP_String, TIME_ZONE_INFORMATION > CP_TimeZone::gRegisteredZones [static, private]
 

CPLAT_Begin_Namespace_CPLAT bool CP_TimeZone::gRegisteredZonesInitialized = false [static, private]
 

CP_Signals_Array* CP_Object::fSignals [protected, inherited]
 

CP_Slots_Array* CP_Object::fSlots [protected, inherited]
 

List of registered signals for this object.

FourCharCode CP_Object::fObjectID [protected, inherited]
 

List of registered slots for this object.

CPLAT_Begin_Namespace_CPLAT FourCharCode CP_Object::fObjectIDCount = 0 [static, protected, inherited]
 

Object identifier.

CFTimeZoneRef CP_CFObject< CFTimeZoneRef >::fCFObject [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:02:21 2005 for CPLAT by  doxygen 1.4.0