All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::Date Class Reference

#include <Date.h>

+ Inheritance diagram for pdftron::PDF::Date:

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)
 
Dateoperator= (const Date &d)
 
bool IsValid () const
 
void SetCurrentTime ()
 
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 ()
 

Detailed Description

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.

Definition at line 28 of file Date.h.

Constructor & Destructor Documentation

pdftron::PDF::Date::Date ( )

Date default constructor.

pdftron::PDF::Date::Date ( SDF::Obj  d)

Create a Date and initialize it using given Cos/SDF string date object. String date object is attached to this Date.

Parameters
dThe Cos/SDF object to initialze the Date object with.
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.

Parameters
yearnumber representing the year to initialize the Date object to.
monthnumber representing the month to initialize the Date object to.
daynumber representing the day to initialize the Date object to.
hournumber representing the hour to initialize the Date object to.
minutenumber representing the minute to initialize the Date object to.
secondnumber representing the second to initialize the Date object to.
pdftron::PDF::Date::Date ( const Date d)

Copy constructor

Member Function Documentation

void pdftron::PDF::Date::Attach ( SDF::Obj  d)

Attach the Cos/SDF object to the Date.

Parameters
d- underlying Cos/SDF object. Must be an SDF::Str containing a PDF date object.
char pdftron::PDF::Date::GetDay ( )
Returns
The day (01-31).
char pdftron::PDF::Date::GetHour ( )
Returns
The hour (00-23).
char pdftron::PDF::Date::GetMinute ( )
Returns
The minute (00-59).
char pdftron::PDF::Date::GetMonth ( )
Returns
The month.
char pdftron::PDF::Date::GetSecond ( )
Returns
The second (00-59).
char pdftron::PDF::Date::GetUT ( )
Returns
The relationship of local time to Universal Time (UT), denoted by one of the characters +, -, or Z
char pdftron::PDF::Date::GetUTHour ( )
Returns
the absolute value of the offset from UT in hours (00-23)
char pdftron::PDF::Date::GetUTMin ( )
Returns
the absolute value of the offset from UT in minutes (00-59)
UInt16 pdftron::PDF::Date::GetYear ( )
Returns
The year.
bool pdftron::PDF::Date::IsValid ( ) const

Indicates whether the Date is valid (non-null).

Returns
True if this is a valid (non-null) Date; otherwise false.
Note
If this method returns false the underlying SDF/Cos object is null and the Date object should be treated as null as well.
Date& pdftron::PDF::Date::operator= ( const Date d)

Assignment operator

void pdftron::PDF::Date::SetCurrentTime ( )

Sets the date object to the current date and time. The method also updates associated SDF object.

bool pdftron::PDF::Date::Update ( SDF::Obj  d = NULL)

Saves changes made to the Date object in the attached (or specified) SDF/Cos string.

Parameters
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.
Returns
true if the attached Cos/SDF string was successfully updated, false otherwise.

The documentation for this class was generated from the following file: