Event Class Reference

#include <event.h>

List of all members.

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)


Detailed Description

A class for storing information about a calendar event. An Event consists of a status, a unique identifier, a name, a location, a start date and time, an end date and time, and a date and time of the event's last modification. The class include methods for reading and writing events in both external and internal formats. That is, the internal format consists of all information, which is required for transfer, storage, and synchronization. The external format * consists of information required for a user view: the name, location, and start and end times of the event.

Author:
Mark Maloof (maloof@cs)
Version:
1.0 01/08/10

Constructor & Destructor Documentation

Event::Event (  ) 

Default constructor. Sets status to a default value of 'A', indicating an active record. String and DateTime objects keep their default values.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
out the output stream for writing

bool Event::operator== ( const Event e  )  const

Returns true if this object's unique identifier is equal to that of the Event object passed as the parameter; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether the objects are equal

bool Event::operator!= ( const Event e  )  const

Returns true if this object's unique identifier is not equal to that of the Event object passed as the parameter; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether the objects are not equal

bool Event::operator< ( const Event e  )  const

Returns true if this Event object's modification date is less than (i.e., earlier than) the parameter's modification date; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether this object is less than the parameter

bool Event::operator> ( const Event e  )  const

Returns true if this Event object's modification date is greater than (i.e., later than) the parameter's modification date; returns false otherwise.

Parameters:
e the Event object to be compared
Returns:
the bool indicating whether this object is greater than the parameter

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.

Returns:
the string containing this event in the internal format

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.

Parameters:
in the input stream for reading
Returns:
a string containing the character sequence


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Event e 
) [friend]

Inserts an Event object in the internal format into the output stream, and returns the modified output stream.

Parameters:
out the output stream for insertion
e the Event for insertion
Returns:
the modified output stream

istream& operator>> ( istream &  in,
Event e 
) [friend]

Extracts an Event in the internal format from the input stream, and returns the modified input stream.

Parameters:
in the input stream for extraction
e the Event for storing the extracted information
Returns:
the modified input stream


Member Data Documentation

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

the date and start time of the event

DateTime Event::end [private]

the date and end time of the event

the date and time of the event record's last modification


The documentation for this class was generated from the following files:

Generated on Wed Jan 20 09:39:02 2010 by  doxygen 1.5.5