00001 #ifndef DATE_PATTERN_H
00002 #define DATE_PATTERN_H
00003
00004
00005 #include <string>
00006 #include <vector>
00007 #include <iostream>
00008
00010 class DatePattern {
00011 public:
00012 DatePattern() {}
00013
00015 DatePattern(const DatePattern& p,unsigned int l);
00016
00018 bool parse(const string& date_string);
00020 void set(unsigned int year, unsigned int month, unsigned int day, unsigned int hours);
00021
00022 const unsigned int operator[](unsigned int i) const { return date_[i]; }
00023 unsigned int size() const { return date_.size(); }
00024
00025 bool operator==(const DatePattern& p) const { return date_ == p.date_; }
00026 bool operator<(const DatePattern& p) const { return date_ < p.date_; }
00027
00028 friend ostream& operator<<(ostream&,const DatePattern&);
00029 private:
00030 vector<unsigned int> date_;
00031 };
00032
00033 #endif