pdftron::PDF::Date Class Reference

The Date class is a utility class used to simplify work with PDF date objects. More...

#include <Date.h>

List of all members.

Public Member Functions

 Date ()
 Date default constructor.
 Date (SDF::Obj d)
 Create a Date and initialize it using given Cos/SDF string date object.
 Date (UInt16 year, char month, char day, char hour, char minute, char second)
 Create a Date and initialize it using specified parameters.
 Date (const Date &d)
 Copy constructor.
Dateoperator= (const Date &d)
 Assignment operator.
bool IsValid () const
 Indicates whether the Date is valid (non-null).
void SetCurrentTime ()
 Sets the date object to the current date and time.
void Attach (SDF::Obj d)
 Attach the Cos/SDF object to the Date.
bool Update (SDF::Obj d=NULL)
 Saves changes made to the Date object in the attached (or specified) SDF/Cos string.
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.


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.

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.

pdftron::PDF::Date::Date ( const Date d  ) 

Copy constructor.


Member Function Documentation

Date& pdftron::PDF::Date::operator= ( const Date d  ) 

Assignment operator.

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.

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::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.

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.

UInt16 pdftron::PDF::Date::GetYear (  ) 

Returns:
The year.

char pdftron::PDF::Date::GetMonth (  ) 

Returns:
The month.

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::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)


© 2002-2010 PDFTron Systems Inc.