#include <Date.h>
Public Member Functions | |
Date () | |
Date (SDF::Obj d) | |
Date (UInt16 year, char month, char day, char hour, char minute, char second) | |
Date (const Date &d) | |
Date & | operator= (const Date &d) |
bool | IsValid () const |
void | SetCurrentTime () |
void | SetUT (char ut) |
void | SetUTHour (Int8 ut_hour) |
void | SetUTMinutes (Int8 ut_minutes) |
void | Attach (SDF::Obj d) |
bool | Update (SDF::Obj d=NULL) |
UInt16 | GetYear () |
char | GetMonth () |
char | GetDay () |
char | GetHour () |
char | GetMinute () |
char | GetSecond () |
char | GetUT () |
char | GetUTHour () |
char | GetUTMin () |
The Date class is a utility class used to simplify work with PDF date objects.
PDF defines a standard date format, which closely follows international standard ASN.1 (Abstract Syntax Notation One), A date is a string of the form (D:YYYYMMDDHHmmSSOHH'mm'); See PDF Reference Manual for details.
Date can be associated with a SDF/Cos date string using Date(Obj*) constructor or later using Date::Attach(Obj*) or Date::Update(Obj*) methods.
Date keeps a local date/time cache so it is necessary to call Date::Update() method if the changes to the Date should be saved in the attached Cos/SDF string.
pdftron::PDF::Date::Date | ( | ) |
Date default constructor.
pdftron::PDF::Date::Date | ( | SDF::Obj | d | ) |
pdftron::PDF::Date::Date | ( | UInt16 | year, |
char | month, | ||
char | day, | ||
char | hour, | ||
char | minute, | ||
char | second | ||
) |
Create a Date and initialize it using specified parameters. The Date is not attached to any Cos/SDF object.
year | number representing the year to initialize the Date object to. |
month | number representing the month to initialize the Date object to. |
day | number representing the day to initialize the Date object to. |
hour | number representing the hour to initialize the Date object to. |
minute | number representing the minute to initialize the Date object to. |
second | number representing the second to initialize the Date object to. |
pdftron::PDF::Date::Date | ( | const Date & | d | ) |
Copy constructor
void pdftron::PDF::Date::Attach | ( | SDF::Obj | d | ) |
char pdftron::PDF::Date::GetDay | ( | ) |
char pdftron::PDF::Date::GetHour | ( | ) |
char pdftron::PDF::Date::GetMinute | ( | ) |
char pdftron::PDF::Date::GetMonth | ( | ) |
char pdftron::PDF::Date::GetSecond | ( | ) |
char pdftron::PDF::Date::GetUT | ( | ) |
char pdftron::PDF::Date::GetUTHour | ( | ) |
char pdftron::PDF::Date::GetUTMin | ( | ) |
UInt16 pdftron::PDF::Date::GetYear | ( | ) |
bool pdftron::PDF::Date::IsValid | ( | ) | const |
void pdftron::PDF::Date::SetCurrentTime | ( | ) |
Sets the date object to the current date and time. The method also updates associated SDF object.
void pdftron::PDF::Date::SetUT | ( | char | ut | ) |
Set the relationship of local time to Universal Time(UT), denoted by one of the characters +, -, or Z
ut | the relationship of local time to Universal Time(UT), |
void pdftron::PDF::Date::SetUTHour | ( | Int8 | ut_hour | ) |
Set the absolute value of the offset from UT in hours(00-23)
ut_hour | the absolute value of the offset from UT in hours(00-23) |
void pdftron::PDF::Date::SetUTMinutes | ( | Int8 | ut_minutes | ) |
Set the absolute value of the offset from UT in minutes(00-59)
ut_minutes | the absolute value of the offset from UT in minutes(00-59) |
bool pdftron::PDF::Date::Update | ( | SDF::Obj | d = NULL | ) |
Saves changes made to the Date object in the attached (or specified) SDF/Cos string.
d | - an optional parameter indicating a SDF string that should be updated and attached to this Date. If parameter d is NULL or is omitted, update is performed on previously attached Cos/SDF date. |