31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

format date :: get input format( )<br />

string date :: get input format str( )<br />

void date :: set output format(format f)<br />

void date :: set output format(string f)<br />

format date :: get output format( )<br />

string date :: get output format str( )<br />

4.2 Access and Update Operations<br />

returns the current input format.<br />

returns the current input format string.<br />

sets the output format to f.<br />

Precondition: f ≠ user def fmt<br />

sets the output format to the user-defined format in<br />

f.<br />

Precondition: f is a valid format string<br />

returns the current output format.<br />

returns the current output format string.<br />

All update operations which may fail have in common that the date is changed and<br />

true is returned if the new date is valid, otherwise false is returned and the date is left<br />

unchanged. (Note that the functions add to day, add to month and add to year can only<br />

fail if the valid range (1.1.1 – 31.12.9999) is exceeded.)<br />

void D.set to current date( )<br />

sets D to the current date.<br />

bool D.set date(int d, month m, int y)<br />

D is set to d.m.y (if d.m.y is valid).<br />

bool<br />

D.set date(const string date str, bool swallow = true)<br />

D is set to the date contained in date str. If swallow<br />

is true, then the format ”m/d/[yy]yy; d?m?[yy]yy” is<br />

used to parse date str, otherwise the current input<br />

format is applied.<br />

string D.get date( ) returns a string representation of D in the current<br />

output format.<br />

int D.get day( ) returns the day part of D, i.e. if D is d.m.y then d is<br />

returned.<br />

month D.get month( ) returns the month part of D.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!