event.h
Go to the documentation of this file.
1 #ifndef EVENT_H
2 #define EVENT_H
3 
4 #include <iostream>
5 #include <string>
6 #include <stdexcept>
7 #include "datetime.h"
8 
26 class Event
27 {
28 
29  friend ostream& operator<<( ostream& out, const Event& e );
30  friend istream& operator>>( istream& in, Event& e ) throw ( invalid_argument );
31 
32  public:
33  Event();
34  string getName() const;
35  string getLocation() const;
36  char getStatus() const;
37  bool matchNameOrLocation( const string& query ) const;
38  bool operator==( const Event& e ) const;
39  bool operator!=( const Event& e ) const;
40  bool operator<( const Event& e ) const;
41  bool operator>( const Event& e ) const;
42  void print( ostream& out = cout ) const;
43  void setStatus( char status ) throw ( invalid_argument );
44 
45  private:
47  char status;
49  string id;
51  string name;
53  string location;
60 
61  string readDoubleQuotedString( istream& in ) const;
62 
63 }; // Event class
64 
65 #endif
66 
char getStatus() const
Definition: event.cc:41
Definition: datetime.h:18
bool matchNameOrLocation(const string &query) const
Definition: event.cc:54
DateTime modified
Definition: event.h:59
void setStatus(char status)
Definition: event.cc:166
bool operator>(const Event &e) const
Definition: event.cc:110
bool operator!=(const Event &e) const
Definition: event.cc:82
bool operator<(const Event &e) const
Definition: event.cc:96
friend ostream & operator<<(ostream &out, const Event &e)
Definition: event.cc:182
void print(ostream &out=cout) const
Definition: event.cc:122
char status
Definition: event.h:47
string getLocation() const
Definition: event.cc:19
bool operator==(const Event &e) const
Definition: event.cc:69
DateTime start
Definition: event.h:55
string location
Definition: event.h:53
friend istream & operator>>(istream &in, Event &e)
Definition: event.cc:207
string id
Definition: event.h:49
Event()
Definition: event.cc:8
string name
Definition: event.h:51
Definition: event.h:26
string readDoubleQuotedString(istream &in) const
Definition: event.cc:139
DateTime end
Definition: event.h:57
string getName() const
Definition: event.cc:30