/usr/include/oce/Quantity_Date.hxx is in liboce-foundation-dev 0.17.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _Quantity_Date_HeaderFile
#define _Quantity_Date_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Storable.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_PrimitiveTypes.hxx>
class Quantity_DateDefinitionError;
class Standard_OutOfRange;
class Quantity_Period;
Standard_EXPORT const Handle(Standard_Type)& STANDARD_TYPE(Quantity_Date);
//! This class provides services to manage date information.
//! A date represents the following time intervals:
//! year, month, day, hour, minute, second,
//! millisecond and microsecond.
//! Current time is expressed in elapsed seconds
//! and microseconds beginning from 00:00 GMT,
//! January 1, 1979 (zero hour). The valid date can
//! only be later than this one.
//! Note: a Period object gives the interval between two dates.
class Quantity_Date
{
public:
DEFINE_STANDARD_ALLOC
//! Constructs a default date
//! (00:00 GMT, January 1, 1979 (zero hour)); use the function
//! SetValues to define the required date; or
Standard_EXPORT Quantity_Date();
//! Constructs a date from the year yyyy, the
//! month mm, the day dd, the hour hh, the minute
//! mn, the second ss, the millisecond mis
//! (defaulted to 0) and the microsecond mics (defaulted to 0)..
//! With: 1 <= mm <= 12
//! 1 <= dd <= max number of days of <mm>
//! 1979 <= yyyy
//! 0 <= hh <= 23
//! 0 <= mn <= 59
//! 0 <= ss <= 59
//! 0 <= mis <= 999
//! 0 <= mics <= 999
//! Exceptions
//! Quantity_DateDefinitionError if mm, dd, hh,
//! mn, ss, mis and mics are not the components of the valid date.
Standard_EXPORT Quantity_Date(const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer yyyy, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis = 0, const Standard_Integer mics = 0);
//! Gets a complete Date.
//! - in mm - the month,
//! - in dd - the day,
//! - in yyyy - the year,
//! - in hh - the hour,
//! - in mn - the minute,
//! - in ss - the second,
//! - in mis - the millisecond, and
//! - in mics - the microsecond
Standard_EXPORT void Values (Standard_Integer& mm, Standard_Integer& dd, Standard_Integer& yy, Standard_Integer& hh, Standard_Integer& mn, Standard_Integer& ss, Standard_Integer& mis, Standard_Integer& mics) const;
//! Assigns to this date the year yyyy, the month
//! mm, the day dd, the hour hh, the minute mn, the
//! second ss, the millisecond mis (defaulted to 0)
//! and the microsecond mics (defaulted to 0).
//! Exceptions
//! Quantity_DateDefinitionError if mm, dd, hh,
//! mn, ss, mis and mics are not components of a valid date.
Standard_EXPORT void SetValues (const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer yy, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis = 0, const Standard_Integer mics = 0) ;
//! Subtracts one Date from another one to find the period
//! between and returns the value.
//! The result is the absolute value between the difference
//! of two dates.
Standard_EXPORT Quantity_Period Difference (const Quantity_Date& anOther) ;
//! Subtracts a period from a Date and returns the new Date.
//! Raises an exception if the result date is anterior to
//! Jan 1, 1979.
Standard_EXPORT Quantity_Date Subtract (const Quantity_Period& aPeriod) ;
Quantity_Date operator - (const Quantity_Period& aPeriod)
{
return Subtract(aPeriod);
}
//! Adds a Period to a Date and returns the new Date.
Standard_EXPORT Quantity_Date Add (const Quantity_Period& aPeriod) ;
Quantity_Date operator + (const Quantity_Period& aPeriod)
{
return Add(aPeriod);
}
//! Returns year of a Date.
Standard_EXPORT Standard_Integer Year() ;
//! Returns month of a Date.
Standard_EXPORT Standard_Integer Month() ;
//! Returns Day of a Date.
Standard_EXPORT Standard_Integer Day() ;
//! Returns Hour of a Date.
Standard_EXPORT Standard_Integer Hour() ;
//! Returns minute of a Date.
Standard_EXPORT Standard_Integer Minute() ;
//! Returns seconde of a Date.
Standard_EXPORT Standard_Integer Second() ;
//! Returns millisecond of a Date.
Standard_EXPORT Standard_Integer MilliSecond() ;
//! Returns microsecond of a Date.
Standard_EXPORT Standard_Integer MicroSecond() ;
//! Returns TRUE if both <me> and <other> are equal.
//! This method is an alias of operator ==.
Standard_EXPORT Standard_Boolean IsEqual (const Quantity_Date& anOther) const;
Standard_Boolean operator == (const Quantity_Date& anOther) const
{
return IsEqual(anOther);
}
//! Returns TRUE if <me> is earlier than <other>.
Standard_EXPORT Standard_Boolean IsEarlier (const Quantity_Date& anOther) const;
Standard_Boolean operator < (const Quantity_Date& anOther) const
{
return IsEarlier(anOther);
}
//! Returns TRUE if <me> is later then <other>.
Standard_EXPORT Standard_Boolean IsLater (const Quantity_Date& anOther) const;
Standard_Boolean operator > (const Quantity_Date& anOther) const
{
return IsLater(anOther);
}
//! Checks the validity of a date - returns true if a
//! date defined from the year yyyy, the month mm,
//! the day dd, the hour hh, the minute mn, the
//! second ss, the millisecond mis (defaulted to 0)
//! and the microsecond mics (defaulted to 0) is valid.
//! A date must satisfy the conditions above:
//! - yyyy is greater than or equal to 1979,
//! - mm lies within the range [1, 12] (with 1
//! corresponding to January and 12 to December),
//! - dd lies within a valid range for the month mm
//! (from 1 to 28, 29, 30 or 31 depending on
//! mm and whether yyyy is a leap year or not),
//! - hh lies within the range [0, 23],
//! - mn lies within the range [0, 59],
//! - ss lies within the range [0, 59],
//! - mis lies within the range [0, 999],
//! - mics lies within the range [0, 999].C
Standard_EXPORT static Standard_Boolean IsValid (const Standard_Integer mm, const Standard_Integer dd, const Standard_Integer yy, const Standard_Integer hh, const Standard_Integer mn, const Standard_Integer ss, const Standard_Integer mis = 0, const Standard_Integer mics = 0) ;
//! Returns true if a year is a leap year.
//! The leap years are divisable by 4 and not by 100 except
//! the years divisable by 400.
static Standard_Boolean IsLeap (const Standard_Integer yy) ;
Standard_Integer _CSFDB_GetQuantity_DatemySec() const { return mySec; }
void _CSFDB_SetQuantity_DatemySec(const Standard_Integer p) { mySec = p; }
Standard_Integer _CSFDB_GetQuantity_DatemyUSec() const { return myUSec; }
void _CSFDB_SetQuantity_DatemyUSec(const Standard_Integer p) { myUSec = p; }
protected:
private:
Standard_Integer mySec;
Standard_Integer myUSec;
};
#include <Quantity_Date.lxx>
#endif // _Quantity_Date_HeaderFile
|