ICU 4.8.1.1  4.8.1.1
tmunit.h
Go to the documentation of this file.
00001 /*
00002  *******************************************************************************
00003  * Copyright (C) 2009-2010, Google, International Business Machines Corporation and *
00004  * others. All Rights Reserved.                                                *
00005  *******************************************************************************
00006  */
00007 
00008 #ifndef __TMUNIT_H__
00009 #define __TMUNIT_H__
00010 
00011 
00018 #include "unicode/measunit.h"
00019 
00020 #if !UCONFIG_NO_FORMATTING
00021 
00022 U_NAMESPACE_BEGIN
00023 
00030 class U_I18N_API TimeUnit: public MeasureUnit {
00031 public:
00036     enum UTimeUnitFields {
00037         UTIMEUNIT_YEAR,
00038         UTIMEUNIT_MONTH,
00039         UTIMEUNIT_DAY,
00040         UTIMEUNIT_WEEK,
00041         UTIMEUNIT_HOUR,
00042         UTIMEUNIT_MINUTE,
00043         UTIMEUNIT_SECOND,
00044         UTIMEUNIT_FIELD_COUNT
00045     };
00046 
00057     static TimeUnit* U_EXPORT2 createInstance(UTimeUnitFields timeUnitField,
00058                                               UErrorCode& status);
00059 
00060 
00065     virtual UObject* clone() const;
00066 
00071     TimeUnit(const TimeUnit& other);
00072 
00077     TimeUnit& operator=(const TimeUnit& other);
00078 
00084     virtual UBool operator==(const UObject& other) const;
00085 
00091     UBool operator!=(const UObject& other) const;
00092 
00101     virtual UClassID getDynamicClassID() const;
00102 
00109     static UClassID U_EXPORT2 getStaticClassID();
00110 
00111 
00117     UTimeUnitFields getTimeUnitField() const;
00118 
00123     virtual ~TimeUnit();
00124 
00125 private:
00126     UTimeUnitFields fTimeUnitField;
00127 
00132     TimeUnit(UTimeUnitFields timeUnitField);
00133 
00134 };
00135 
00136 
00137 inline UBool 
00138 TimeUnit::operator!=(const UObject& other) const {
00139     return !operator==(other);
00140 }
00141 
00142 
00143 U_NAMESPACE_END
00144 
00145 #endif /* #if !UCONFIG_NO_FORMATTING */
00146 
00147 #endif // __TMUNIT_H__
00148 //eof
00149 //
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines