Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

datepattern.h

Go to the documentation of this file.
00001 #ifndef DATE_PATTERN_H
00002 #define DATE_PATTERN_H
00003 
00004 // $Id: datepattern.h,v 1.2 2001/04/12 14:55:56 dvermeir Exp $
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_; // 0 = year, 1 = month, 2 = day, 3 = hours
00031 };
00032 
00033 #endif

httpstats-stage02a [ 7 April, 2001]