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-source.html,v 1.1 2001/04/16 17:42:59 dvermeir Exp $
00005 #include <string>
00006 #include <vector>
00007 #include <iostream>
00008 
00009 class DatePattern {
00010 public:
00011   DatePattern() {}
00012   
00014   DatePattern(const DatePattern& p,unsigned int l);
00015 
00017   bool parse(const string& date_string); 
00018   // Set max no of components explicitly.
00019   void set(unsigned int year, unsigned int month, unsigned int day, unsigned int hours);
00020 
00021   const unsigned int operator[](unsigned int i) const { return date_[i]; }
00022   unsigned int size() const { return date_.size(); }
00023 
00024   bool operator==(const DatePattern& p) const { return date_ == p.date_; }
00025   bool operator<(const DatePattern& p) const { return date_ < p.date_; }
00026 
00027   typedef vector<unsigned int>::const_iterator iterator;
00028   iterator begin() const { return date_.begin(); }
00029   iterator end() const { return date_.end(); }
00030 
00031   friend ostream& operator<<(ostream&,const DatePattern&);
00032 private:
00034   vector<unsigned int> date_; 
00035 };
00036 
00037 #endif

httpstats-stage04 [ 7 April, 2001]