#include <event.h>
Public Member Functions | |
Event () | |
void | setStatus (char status) |
char | getStatus () const |
void | read (istream &in) |
void | writeln (ostream &out) const |
void | println (ostream &out=cout) const |
bool | operator== (const Event &e) const |
bool | operator!= (const Event &e) const |
bool | operator< (const Event &e) const |
bool | operator> (const Event &e) const |
string | toString () const |
Private Member Functions | |
string | readDoubleQuotedString (istream &in) const |
Private Attributes | |
char | status |
string | id |
string | name |
string | location |
DateTime | start |
DateTime | end |
DateTime | modified |
Friends | |
ostream & | operator<< (ostream &out, const Event &e) |
istream & | operator>> (istream &in, Event &e) |
Event::Event | ( | ) |
Default constructor. Sets status to a default value of 'A', indicating an active record. String and DateTime objects keep their default values.
void Event::setStatus | ( | char | status | ) |
Sets the status of this Event object. The status of an Event object is either 'A' for an active event or 'D' for a deleted object. For invalid values for status, the method fails silently by keeping the object's curent value for status.
status | a character indicating this Event object's status |
char Event::getStatus | ( | ) | const |
Returns this Event object's status.
char a character representing this object's status
void Event::read | ( | istream & | in | ) |
Reads an Event object in an internal format from the input stream. The internal format of an object consists of its status, unique identifier, name, location, start date and time, end date and time, and the date and time of the event's last modification.
in | the input stream for reading |
void Event::writeln | ( | ostream & | out | ) | const |
Writes this Event object in the internal format followed by an end-of-line character to the output stream.
out | the output stream for writing |
void Event::println | ( | ostream & | out = cout |
) | const |
Prints this Event object in the external format (i.e., a format that would be useful for display in an interface.
out | the output stream for writing |
bool Event::operator== | ( | const Event & | e | ) | const |
bool Event::operator!= | ( | const Event & | e | ) | const |
bool Event::operator< | ( | const Event & | e | ) | const |
bool Event::operator> | ( | const Event & | e | ) | const |
string Event::toString | ( | ) | const |
Returns the string representation of this Event object in the internal format. The internal format consists of the status, unique identifier, name, location, start date and time, end date and time, and date and time of the last modification. The name and location are delimited by double quotes. Each field is delimited by one tab character.
string Event::readDoubleQuotedString | ( | istream & | in | ) | const [private] |
Reads the next character sequence between two double quotation marks from the input stream and returns the characters as a string. The first printable character in the stream must be a double quote.
in | the input stream for reading |
ostream& operator<< | ( | ostream & | out, | |
const Event & | e | |||
) | [friend] |
istream& operator>> | ( | istream & | in, | |
Event & | e | |||
) | [friend] |
char Event::status [private] |
the status of the event record
string Event::id [private] |
the unique identifier of the event record
string Event::name [private] |
the name of the event
string Event::location [private] |
the location of the event
DateTime Event::start [private] |
the date and start time of the event
DateTime Event::end [private] |
the date and end time of the event
DateTime Event::modified [private] |
the date and time of the event record's last modification