CFx SDK Documentation  2020SP3
OdTimeStamp.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef _ODTIME_INCLUDED_
28 #define _ODTIME_INCLUDED_
29 
30 #include "TD_PackPush.h"
31 class OdString;
32 
42 {
43 public:
45  {
46  kInitZero = 1, // Midnight, January 1, 1970, UTC.
47  kInitLocalTime = 2, // Workstation date in local time.
48  kInitUniversalTime = 3 // Workstation date in Universal (Greenwich Mean) Time.
49  };
50 
67  InitialValue init);
68 
75  void getDate(
76  short& month,
77  short& day,
78  short& year) const;
79 
86  void setDate(
87  short month,
88  short day,
89  short year);
90 
94  short month() const;
95 
100  void setMonth(
101  short month);
102 
106  short day() const;
107 
112  void setDay(
113  short day);
114 
118  short year() const;
119 
124  void setYear(
125  short year);
126 
134  void getTime(
135  short& hour,
136  short& minute,
137  short& second,
138  short& millisecond) const;
139 
147  void setTime(
148  short hour,
149  short minute,
150  short second,
151  short millisecond);
152 
156  short hour() const;
157 
162  void setHour(
163  short hour);
164 
168  short minute() const;
169 
174  void setMinute(
175  short minute);
176 
180  short second() const;
181 
186  void setSecond(short second);
187 
191  short millisecond() const;
192 
198  short millisecond);
199 
203  void setToZero();
204 
208  void getLocalTime();
209 
214 
219 
224 
229 
236  OdUInt32 julianDay);
237 
242 
249  OdUInt32 msecsPastMidnight);
250 
258  OdUInt32 julianDay,
259  OdUInt32 msecsPastMidnight);
260 
267  double julianFraction() const;
268 
276  double julianFraction);
277 
279  const OdTimeStamp& tStamp) const;
280 
282  const OdTimeStamp& tStamp) const
283  {
284  return !(operator==(tStamp));
285  }
286 
287  bool operator>(
288  const OdTimeStamp& tStamp) const;
289 
291  const OdTimeStamp& tStamp) const
292  {
293  return ! operator<(tStamp);
294  }
295 
296  bool operator<(
297  const OdTimeStamp& tStamp) const;
298 
300  const OdTimeStamp& tStamp) const
301  {
302  return ! operator>(tStamp);
303  }
304 
306  const OdTimeStamp &tStamp) const
307  {
308  return OdTimeStamp(*this) += tStamp;
309  }
310 
312  const OdTimeStamp &tStamp) const
313  {
314  return OdTimeStamp(*this) -= tStamp;
315  }
316 
318  const OdTimeStamp &tStamp);
319 
321  const OdTimeStamp &tStamp);
322 
328  const OdTimeStamp& add(
329  const OdTimeStamp &tStamp)
330  {
331  return operator+=(tStamp);
332  }
333 
340  const OdTimeStamp &tStamp)
341  {
342  return operator-=(tStamp);
343  }
344 
355  void ctime(
356  class OdString& timeString) const;
357 
406  void strftime(
407  const OdString& format,
408  OdString &timeString) const;
409 
421  short weekday() const;
422 private:
423  OdUInt32 m_julianDay;
424  OdUInt32 m_msec;
425 };
426 #include "TD_PackPop.h"
427 
428 #endif // _ODTIME_INCLUDED_
429 
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdString
Definition: OdString.h:95
OdTimeStamp::weekday
short weekday() const
OdTimeStamp::millisecond
short millisecond() const
OdTimeStamp::getDate
void getDate(short &month, short &day, short &year) const
OdTimeStamp::getLocalTime
void getLocalTime()
OdTimeStamp::day
short day() const
OdTimeStamp
Definition: OdTimeStamp.h:42
OdInt64
Definition: Int64.h:43
OdTimeStamp::setSecond
void setSecond(short second)
OdTimeStamp::setToZero
void setToZero()
OdTimeStamp::InitialValue
InitialValue
Definition: OdTimeStamp.h:45
OdTimeStamp::operator!=
bool operator!=(const OdTimeStamp &tStamp) const
Definition: OdTimeStamp.h:281
OdTimeStamp::strftime
void strftime(const OdString &format, OdString &timeString) const
OdTimeStamp::setJulianFraction
void setJulianFraction(double julianFraction)
TD_PackPop.h
OdTimeStamp::setMinute
void setMinute(short minute)
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdTimeStamp::setYear
void setYear(short year)
OdTimeStamp::month
short month() const
OdTimeStamp::operator==
bool operator==(const OdTimeStamp &tStamp) const
OdTimeStamp::OdTimeStamp
OdTimeStamp(InitialValue init)
OdTimeStamp::setMonth
void setMonth(short month)
OdTimeStamp::julianFraction
double julianFraction() const
OdTimeStamp::subtract
const OdTimeStamp & subtract(const OdTimeStamp &tStamp)
Definition: OdTimeStamp.h:339
OdTimeStamp::setDay
void setDay(short day)
OdTimeStamp::setTime
void setTime(short hour, short minute, short second, short millisecond)
OdTimeStamp::operator<=
bool operator<=(const OdTimeStamp &tStamp) const
Definition: OdTimeStamp.h:299
OdTimeStamp::operator+
const OdTimeStamp operator+(const OdTimeStamp &tStamp) const
Definition: OdTimeStamp.h:305
operator>
bool operator>(const OdString &s1, const OdString &s2)
Definition: OdString.h:1307
OdTimeStamp::minute
short minute() const
OdTimeStamp::setMsecsPastMidnight
void setMsecsPastMidnight(OdUInt32 msecsPastMidnight)
OdTimeStamp::operator-=
const OdTimeStamp & operator-=(const OdTimeStamp &tStamp)
OdTimeStamp::setPackedValue
void setPackedValue(OdInt64 t)
OdTimeStamp::setHour
void setHour(short hour)
TD_PackPush.h
OdTimeStamp::julianDay
OdUInt32 julianDay() const
OdTimeStamp::setMillisecond
void setMillisecond(short millisecond)
OdTimeStamp::getUniversalTime
void getUniversalTime()
operator<
bool operator<(const OdString &s1, const OdString &s2)
Definition: OdString.h:1284
OdTimeStamp::second
short second() const
OdTimeStamp::operator>=
bool operator>=(const OdTimeStamp &tStamp) const
Definition: OdTimeStamp.h:290
OdTimeStamp::universalToLocal
void universalToLocal()
OdTimeStamp::OdTimeStamp
OdTimeStamp()
OdTimeStamp::msecsPastMidnight
OdUInt32 msecsPastMidnight() const
OdTimeStamp::hour
short hour() const
format
GLint GLint GLint GLsizei GLsizei GLenum format
Definition: gles2_ext.h:111
OdDAI::operator==
bool DAI_EXPORT operator==(const OdFileDescriptionAuto &left, const OdFileDescriptionAuto &right)
OdTimeStamp::setJulianDate
void setJulianDate(OdUInt32 julianDay, OdUInt32 msecsPastMidnight)
OdTimeStamp::operator+=
const OdTimeStamp & operator+=(const OdTimeStamp &tStamp)
OdTimeStamp::operator<
bool operator<(const OdTimeStamp &tStamp) const
OdTimeStamp::packedValue
OdInt64 packedValue() const
OdTimeStamp::operator>
bool operator>(const OdTimeStamp &tStamp) const
OdTimeStamp::add
const OdTimeStamp & add(const OdTimeStamp &tStamp)
Definition: OdTimeStamp.h:328
OdTimeStamp::setJulianDay
void setJulianDay(OdUInt32 julianDay)
OdTimeStamp::localToUniversal
void localToUniversal()
OdTimeStamp::operator-
const OdTimeStamp operator-(const OdTimeStamp &tStamp) const
Definition: OdTimeStamp.h:311
OdTimeStamp::getTime
void getTime(short &hour, short &minute, short &second, short &millisecond) const
OdTimeStamp::year
short year() const
OdTimeStamp::setDate
void setDate(short month, short day, short year)
OdTimeStamp::ctime
void ctime(class OdString &timeString) const