Loading...
Searching...
No Matches
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)
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 ()

## 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

## ◆ Date() [1/4]

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

Date default constructor.

## ◆ Date() [2/4]

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

  d | The Cos/SDF object to initialze the Date object with.

## ◆ Date() [3/4]

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

  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.

## ◆ Date() [4/4]

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

Copy constructor

## Member Function Documentation

## ◆ Attach()

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.

## ◆ GetDay()

char pdftron::PDF::Date::GetDay | ( |  | ) |

Returns
  The day (01-31).

## ◆ GetHour()

char pdftron::PDF::Date::GetHour | ( |  | ) |

Returns
  The hour (00-23).

## ◆ GetMinute()

char pdftron::PDF::Date::GetMinute | ( |  | ) |

Returns
  The minute (00-59).

## ◆ GetMonth()

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

Returns
  The month.

## ◆ GetSecond()

char pdftron::PDF::Date::GetSecond | ( |  | ) |

Returns
  The second (00-59).

## ◆ GetUT()

char pdftron::PDF::Date::GetUT | ( |  | ) |

Returns
  The relationship of local time to Universal Time (UT), denoted by one of the characters +, -, or Z

## ◆ GetUTHour()

char pdftron::PDF::Date::GetUTHour | ( |  | ) |

Returns
  the absolute value of the offset from UT in hours (00-23)

## ◆ GetUTMin()

char pdftron::PDF::Date::GetUTMin | ( |  | ) |

Returns
  the absolute value of the offset from UT in minutes (00-59)

## ◆ GetYear()

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

Returns
  The year.

## ◆ IsValid()

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.

## ◆ operator=()

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

Assignment operator

## ◆ SetCurrentTime()

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

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

## ◆ SetUT()

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

Parameters

  ut | the relationship of local time to Universal Time(UT),

## ◆ SetUTHour()

void pdftron::PDF::Date::SetUTHour | ( | Int8 | ut_hour | ) |

Set the absolute value of the offset from UT in hours(00-23)

Parameters

  ut_hour | the absolute value of the offset from UT in hours(00-23)

## ◆ SetUTMinutes()

void pdftron::PDF::Date::SetUTMinutes | ( | Int8 | ut_minutes | ) |

Set the absolute value of the offset from UT in minutes(00-59)

Parameters

  ut_minutes | the absolute value of the offset from UT in minutes(00-59)

## ◆ Update()

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:

- PDF/Date.h