#include <calendar.h>
Public Member Functions | |
Calendar () | |
bool | read (string filename) |
bool | read (istream &in) |
bool | write (string filename) |
bool | write (ostream &out=cout) |
void | print (ostream &out=cout) |
void | synchronize (Calendar &e) |
Private Member Functions | |
void | synchronize (vector< Event > &e1, vector< Event > &e2) |
Private Attributes | |
vector< Event > | events |
Calendar::Calendar | ( | ) |
Default constructor.
bool Calendar::read | ( | string | filename | ) |
Reads the events in the internal format from the file named filename
, and stores them in the vector events
. Returns true if the read operation is successful; returns false otherwise.
filename | the name of the file containing the events |
bool Calendar::read | ( | istream & | in | ) |
Reads the events in the internal format from the input stream, and stores them in the vector events
. Returns true if the read operation is successful; returns false otherwise.
in | the input stream name containing the events |
bool Calendar::write | ( | string | filename | ) |
Writes the events of this Calendar to the file named filename
in the internal format. Returns true if the read operation is successful; returns false otherwise.
filename | the name of the file for writing |
bool Calendar::write | ( | ostream & | out = cout |
) |
Writes the events of this Calendar to the output stream in the internal format.
out | the output stream for writing |
void Calendar::print | ( | ostream & | out = cout |
) |
Prints the events of this Calendar to the output stream in a format suitable for a user view, meaning that the events are printed in the external format. This view does not include deleted events.
out | the output stream for printing |
void Calendar::synchronize | ( | Calendar & | calendar | ) |
Synchronizes events e2
to e1
. For each event in e1
.
e1 | a vector of events | |
e2 | a vector of events |
vector<Event> Calendar::events [private] |
the events of this calendar