zipios
2.2.0
Zipios -- a small C++ library that provides easy access to .zip files.
|
Go to the documentation of this file.
105 31 + 0 + 31 + 30 + 31,
106 31 + 0 + 31 + 30 + 31 + 30,
107 31 + 0 + 31 + 30 + 31 + 30 + 31,
108 31 + 0 + 31 + 30 + 31 + 30 + 31 + 31,
109 31 + 0 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
110 31 + 0 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
111 31 + 0 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
190 return ((year) % 400) == 0
192 : (((year) % 100) == 0
334 throw InvalidException(
"Second is out of range for an MS-DOS Date & Time object. Range is [0, 59].");
359 throw InvalidException(
"Minute is out of range for an MS-DOS Date & Time object. Range is [0, 59].");
384 throw InvalidException(
"Hour is out of range for an MS-DOS Date & Time object. Range is [0, 23].");
414 throw InvalidException(
"Day of the month is out of range for an MS-DOS Date & Time object. Range is [1, 31].");
438 throw InvalidException(
"Month out of range for an MS-DOS Date & Time object. Range is [1, 12].");
464 throw InvalidException(
"Year out of range for an MS-DOS Date & Time object. Range is [1980, 2107].");
547 unix_timestamp &= -2;
550 localtime_r(&unix_timestamp, &t);
557 if(t.tm_year < 1980 - 1900
558 || t.tm_year > 2107 - 1900)
560 throw InvalidException(
"Year out of range for an MS-DOS Date & Time object. Range is [1980, 2107].");
612 if(
sizeof(std::time_t) == 4
613 && t.tm_year >= 2038)
622 throw InvalidException(
"Year out of range for a 32 bit Unix Timestamp object. Range is (1901, 2038).");
void setMonth(int month)
Set the month.
int getMinute() const
Get the minute.
DOSDateTime::dosdatetime_t m_minute
static const dosdatetime_t g_min_dosdatetime
static const dosdatetime_t g_max_dosdatetime
int getYear() const
Get the year.
std::time_t getUnixTimestamp() const
Retrieve the DOSDateTime as a Unix timestamp.
DOSDateTime::dosdatetime_t m_mday
void setMDay(int mday)
Set the day of the month.
dosdatetime_t getDOSDateTime() const
Retrieve the DOSDateTime value as is.
Various exceptions used throughout the Zipios library, all based on zipios::Exception.
Define a type to manage date and time in MS-DOS format.
void setYear(int year)
Set the year.
DOSDateTime::dosdatetime_t m_month
int getHour() const
Get the hour.
void setSecond(int second)
Set the second.
DOSDateTime::dosdatetime_t m_dosdatetime
int getMDay() const
Get the day of the month.
void setHour(int hour)
Set the hour.
bool isValid() const
Check whether this DOS Date & Date is valid.
void setMinute(int minute)
Set the minute.
const int g_days_in_month[12]
Number of days in a month.
int daysInMonth() const
Calculate the number of days in this date's month.
dosdatetime_t m_dosdatetime
void setDOSDateTime(dosdatetime_t datetime)
Set the DOSDateTime value as is.
DOSDateTime::dosdatetime_t m_year
DOSDateTime::dosdatetime_t m_hour
int getMonth() const
Get the month.
int getSecond() const
Get the second.
An InvalidException is used when invalid data is provided.
void setUnixTimestamp(std::time_t unix_timestamp)
Set the DOSDateTime value from a Unix timestamp.
struct zipios::dosdatetime_convert_t::fields m_fields
Union used to convert the uint32_t to fields and vice versa.
The zipios namespace includes the Zipios library definitions.
DOSDateTime::dosdatetime_t m_second