My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
Month.h
Go to the documentation of this file.
1 // $Id: Month.h,v 1.1 2010/02/23 17:19:57 eml Exp $
2 
3 #ifndef GCP_UTIL_MONTH_H
4 #define GCP_UTIL_MONTH_H
5 
15 #include <map>
16 
17 namespace gcp {
18  namespace util {
19 
20  class Month {
21  public:
22 
26  Month();
27 
31  virtual ~Month();
32 
33  static std::string fullMonthName(unsigned iMonth, bool capitalize=true);
34  static std::string abbreviatedMonthName(unsigned iMonth, bool capitalize=true);
35  static unsigned daysInMonth(unsigned iMonth, unsigned iYear);
36 
37  private:
38 
39  static std::map<unsigned, std::string> monthNames_;
40  static std::map<unsigned, std::string> createNameMap();
41 
42  static std::map<unsigned, unsigned> monthDays_;
43  static std::map<unsigned, unsigned> createDayMap();
44 
45  static void validateMonthIndex(unsigned iMonth);
46 
47  }; // End class Month
48 
49  } // End namespace util
50 } // End namespace gcp
51 
52 
53 
54 #endif // End #ifndef GCP_UTIL_MONTH_H
static unsigned daysInMonth(unsigned iMonth, unsigned iYear)
Definition: Month.cc:68
static std::string fullMonthName(unsigned iMonth, bool capitalize=true)
Definition: Month.cc:24
Month()
Definition: Month.cc:11
virtual ~Month()
Definition: Month.cc:16
Definition: Month.h:20
static std::string abbreviatedMonthName(unsigned iMonth, bool capitalize=true)
Definition: Month.cc:39