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.

3. Creation<br />

date D;<br />

creates an instance D of type date and initializes it to the current<br />

date.<br />

date D(int d, month m, int y);<br />

creates an instance D of type date and initializes it to d.m.y.<br />

Precondition: d.m.y represents a valid date.<br />

date D(string date str, bool swallow = true);<br />

creates an instance D of type date and initializes it to date given<br />

in date str.<br />

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

used to parse date str, otherwise the current input format is applied.<br />

Precondition: date str represents a valid date.<br />

4. Operations<br />

4.1 Languages and Input/Output Formats<br />

void date :: set language(language l)<br />

sets the language to l, which means that the month<br />

names and the weekday names are set according to<br />

the language.<br />

Precondition: l ≠ user def lang<br />

void<br />

void<br />

language<br />

date :: set month names(const char ∗ names[])<br />

date :: set dow names(const char ∗ names[])<br />

sets the names for the months and changes the language<br />

to user def lang.<br />

Precondition: names[0..11] contains the names for the<br />

months from January to December.<br />

sets the names for the weekdays and changes the language<br />

to user def lang.<br />

Precondition: names[0..6] contains the names for the<br />

weekdays from Monday to Sunday.<br />

date :: get language( ) returns the current language.<br />

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

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

sets the input format to f.<br />

Precondition: f ≠ user def fmt<br />

sets the input format to the user-defined format in f.<br />

Precondition: f is a valid format string

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

Saved successfully!

Ooh no, something went wrong!