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
00028
00029
00030 #ifndef OFDATE_H
00031 #define OFDATE_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034
00035 BEGIN_EXTERN_C
00036 #ifdef HAVE_SYS_TYPES_H
00037 # include <sys/types.h>
00038 #endif
00039 END_EXTERN_C
00040
00041 #include "dcmtk/ofstd/ofstring.h"
00042 #include "dcmtk/ofstd/ofstream.h"
00043
00044
00045
00046
00047
00048
00051 class OFDate
00052 {
00053
00054 friend class OFDateTime;
00055
00056
00057 public:
00058
00062 OFDate();
00063
00067 OFDate(const OFDate &dateVal);
00068
00074 OFDate(const unsigned int year,
00075 const unsigned int month,
00076 const unsigned int day);
00077
00080 virtual ~OFDate();
00081
00086 virtual OFDate &operator=(const OFDate &dateVal);
00087
00092 virtual OFBool operator==(const OFDate &dateVal) const;
00093
00098 virtual OFBool operator!=(const OFDate &dateVal) const;
00099
00105 virtual OFBool operator<(const OFDate &dateVal) const;
00106
00112 virtual OFBool operator<=(const OFDate &dateVal) const;
00113
00119 virtual OFBool operator>=(const OFDate &dateVal) const;
00120
00126 virtual OFBool operator>(const OFDate &dateVal) const;
00127
00131 virtual void clear();
00132
00139 virtual OFBool isValid() const;
00140
00148 OFBool setDate(const unsigned int year,
00149 const unsigned int month,
00150 const unsigned int day);
00151
00157 OFBool setYear(const unsigned int year);
00158
00164 OFBool setMonth(const unsigned int month);
00165
00171 OFBool setDay(const unsigned int day);
00172
00178 OFBool setCurrentDate();
00179
00186 OFBool setISOFormattedDate(const OFString &formattedDate);
00187
00191 unsigned int getYear() const;
00192
00196 unsigned int getMonth() const;
00197
00201 unsigned int getDay() const;
00202
00210 OFBool getISOFormattedDate(OFString &formattedDate,
00211 const OFBool showDelimiter = OFTrue) const;
00212
00213
00214
00218 static OFDate getCurrentDate();
00219
00220
00221 protected:
00222
00229 OFBool setCurrentDate(const time_t &tt);
00230
00231
00232
00242 static OFBool isDateValid(const unsigned int year,
00243 const unsigned int month,
00244 const unsigned int day);
00245
00246
00247 private:
00248
00250 unsigned int Year;
00251
00253 unsigned int Month;
00254
00256 unsigned int Day;
00257 };
00258
00259
00266 STD_NAMESPACE ostream& operator<<(STD_NAMESPACE ostream& stream, const OFDate &dateVal);
00267
00268
00269 #endif
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306