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 
27 class Event
28 {
29 
30  friend ostream& operator<<( ostream& out, const Event& e );
31  friend istream& operator>>( istream& in, Event& e );
32 
33  public:
34  Event();
35  string getName() const;
36  string getLocation() const;
37  char getStatus() const;
38  bool matchNameOrLocation( const string& query ) const;
39  bool operator==( const Event& e ) const;
40  bool operator!=( const Event& e ) const;
41  bool operator<( const Event& e ) const;
42  bool operator>( const Event& e ) const;
43  void print( ostream& out = cout ) const;
44  void setStatus( char status ); // throw ( invalid_argument );
45 
46  private:
48  char status;
50  string id;
52  string name;
54  string location;
61 
62  string readDoubleQuotedString( istream& in ) const;
63 
64 }; // Event class
65 
66 #endif
67 
char getStatus() const
Definition: event.cc:41
Definition: datetime.h:19
bool matchNameOrLocation(const string &query) const
Definition: event.cc:54
DateTime modified
Definition: event.h:60
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:48
string getLocation() const
Definition: event.cc:19
bool operator==(const Event &e) const
Definition: event.cc:69
DateTime start
Definition: event.h:56
string location
Definition: event.h:54
friend istream & operator>>(istream &in, Event &e)
Definition: event.cc:208
string id
Definition: event.h:50
Event()
Definition: event.cc:8
string name
Definition: event.h:52
Definition: event.h:27
string readDoubleQuotedString(istream &in) const
Definition: event.cc:139
DateTime end
Definition: event.h:58
string getName() const
Definition: event.cc:30