Calendar Class Reference

#include <calendar.h>

List of all members.

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< Eventevents


Detailed Description

A class for storing events of a calendar that can be synchronized with other calendars. Methods exist to read and write events to and from files, which serve as proxies for sending and receiving between calendars on devices, on computers, and in the cloud.

Author:
Mark Maloof (maloof@cs)
Version:
1.0 1/8/10

Constructor & Destructor Documentation

Calendar::Calendar (  ) 

Default constructor.


Member Function Documentation

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.

Parameters:
filename the name of the file containing the events
Returns:
the bool indicating if the read operation is successful

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.

Parameters:
in the input stream name containing the events
Returns:
the bool indicating whether the read operation is successful

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.

Parameters:
filename the name of the file for writing
Returns:
the bool indicating if the write operation is successful

bool Calendar::write ( ostream &  out = cout  ) 

Writes the events of this Calendar to the output stream in the internal format.

Parameters:
out the output stream for writing
Returns:
the bool indicating if the write operation is successful

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.

Parameters:
out the output stream for printing

void Calendar::synchronize ( Calendar calendar  ) 

Synchonizes this Calendar with the Calendar passed as a parameter.

Parameters:
calendar the calendar

void Calendar::synchronize ( vector< Event > &  e1,
vector< Event > &  e2 
) [private]

Synchronizes events e2 to e1. For each event in e1.

Parameters:
e1 a vector of events
e2 a vector of events


Member Data Documentation

vector<Event> Calendar::events [private]

the events of this calendar


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