00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029
00030
00031
00032 #ifndef Pegasus_CIMDateTime_h
00033 #define Pegasus_CIMDateTime_h
00034
00035 #include <Pegasus/Common/Config.h>
00036 #include <Pegasus/Common/Array.h>
00037 #include <Pegasus/Common/Linkage.h>
00038
00039 PEGASUS_NAMESPACE_BEGIN
00040
00041 class CIMDateTimeRep;
00042
00118 class PEGASUS_COMMON_LINKAGE CIMDateTime
00119 {
00120 public:
00121
00122 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00123
00126 static const Uint32 WILDCARD;
00127
00128 #endif
00129
00132 CIMDateTime();
00133
00137 CIMDateTime(const CIMDateTime& x);
00138
00148 CIMDateTime(const String& str);
00149
00162 CIMDateTime(Uint64 usec, Boolean isInterval);
00163
00164 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00165
00181 CIMDateTime(
00182 Uint32 year,
00183 Uint32 month,
00184 Uint32 day,
00185 Uint32 hours,
00186 Uint32 minutes,
00187 Uint32 seconds,
00188 Uint32 microseconds,
00189 Uint32 numSignificantMicrosecondDigits,
00190 Sint32 utcOffset);
00191
00204 CIMDateTime(
00205 Uint32 days,
00206 Uint32 hours,
00207 Uint32 minutes,
00208 Uint32 seconds,
00209 Uint32 microseconds,
00210 Uint32 numSignificantMicrosecondDigits);
00211
00212 #endif
00213
00215 ~CIMDateTime();
00216
00229 CIMDateTime& operator=(const CIMDateTime& x);
00230
00235 String toString() const;
00236
00251 void set(const String & str);
00252
00253 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00254
00270 void setTimeStamp(
00271 Uint32 year,
00272 Uint32 month,
00273 Uint32 day,
00274 Uint32 hours,
00275 Uint32 minutes,
00276 Uint32 seconds,
00277 Uint32 microseconds,
00278 Uint32 numSignificantMicrosecondDigits,
00279 Sint32 utcOffset);
00280
00293 void setInterval(
00294 Uint32 days,
00295 Uint32 hours,
00296 Uint32 minutes,
00297 Uint32 seconds,
00298 Uint32 microseconds,
00299 Uint32 numSignificantMicrosecondDigits);
00300
00301 #endif
00302
00306 void clear();
00307
00311 static CIMDateTime getCurrentDateTime();
00312
00322 static Sint64 getDifference(CIMDateTime startTime, CIMDateTime finishTime);
00323
00327 Boolean isInterval() const;
00328
00333 Boolean isInterval();
00334
00335 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
00336
00340 Boolean isTimeStamp() const;
00341
00342 #endif
00343
00350 Boolean equal(const CIMDateTime& x) const;
00351
00358 Uint64 toMicroSeconds() const;
00359
00370 CIMDateTime operator+(const CIMDateTime& x) const;
00371
00382 CIMDateTime & operator+=(const CIMDateTime& x);
00383
00395 CIMDateTime operator-(const CIMDateTime& x) const;
00396
00409 CIMDateTime & operator-=(const CIMDateTime& x);
00410
00421 CIMDateTime operator*(Uint64 x) const;
00422
00434 CIMDateTime & operator*=(Uint64 x);
00435
00447 CIMDateTime operator/(Uint64 num) const;
00448
00461 CIMDateTime & operator/=(Uint64 num);
00462
00475 Uint64 operator/(const CIMDateTime& cdt) const;
00476
00486 Boolean operator<(const CIMDateTime& x) const;
00487
00498 Boolean operator<=(const CIMDateTime& x) const;
00499
00509 Boolean operator>(const CIMDateTime & x) const;
00510
00521 Boolean operator>=(const CIMDateTime & x) const;
00522
00532 Boolean operator!=(const CIMDateTime & x) const;
00533
00534 private:
00535 CIMDateTimeRep* _rep;
00536 CIMDateTime(CIMDateTimeRep*);
00537 };
00538
00546 PEGASUS_COMMON_LINKAGE Boolean operator==(
00547 const CIMDateTime& x,
00548 const CIMDateTime& y);
00549
00550 #define PEGASUS_ARRAY_T CIMDateTime
00551 # include <Pegasus/Common/ArrayInter.h>
00552 #undef PEGASUS_ARRAY_T
00553
00554 PEGASUS_NAMESPACE_END
00555
00556 #endif