* This class provide an easy way to build a date formed by day, month and year */
| 57 | * This class provide an easy way to build a date formed by day, month and year |
| 58 | */ |
| 59 | class cookie_date { |
| 60 | public: |
| 61 | /** |
| 62 | * Default constructor. Inizialize the attributes with default values. |
| 63 | */ |
| 64 | cookie_date() : day(1), month("Jan"), week_day("Mon"), year(1970) {} |
| 65 | /** |
| 66 | * Constructor with parameters, which gives a fast way to build a cookie_date object. |
| 67 | */ |
| 68 | cookie_date(unsigned int, unsigned int, unsigned int, unsigned int) NOEXCEPT; |
| 69 | /** |
| 70 | * This method allows to specify the week dayname for the date. If the day is less or equal |
| 71 | * than zero or greater than 7, 1 will be choosen |
| 72 | */ |
| 73 | cookie_date *set_week_day(unsigned int) NOEXCEPT; |
| 74 | /** |
| 75 | * This method allows to specify a day for the date. If the day is less than zero or |
| 76 | * greater than 31, 1 will be choosen. |
| 77 | */ |
| 78 | cookie_date *set_day(unsigned int) NOEXCEPT; |
| 79 | /** |
| 80 | * This method allows to specify a month for the date. If the month is not supported, |
| 81 | * January will be choosen. |
| 82 | */ |
| 83 | cookie_date *set_month(unsigned int); |
| 84 | /** |
| 85 | * This method allows to specify a year for the date. If year is less than 1970, 1970 will |
| 86 | * be choosen. |
| 87 | */ |
| 88 | cookie_date *set_year(unsigned int) NOEXCEPT; |
| 89 | /** |
| 90 | * This method returns the week day name |
| 91 | */ |
| 92 | std::string get_week_day() const NOEXCEPT; |
| 93 | /** |
| 94 | * This method returns the day number. |
| 95 | */ |
| 96 | unsigned int get_day() const NOEXCEPT; |
| 97 | /** |
| 98 | * This method returns the month name. |
| 99 | */ |
| 100 | std::string get_month() const NOEXCEPT; |
| 101 | /** |
| 102 | * This method returns the year number. |
| 103 | */ |
| 104 | unsigned int get_year() const NOEXCEPT; |
| 105 | /** |
| 106 | * This method returns the date formatted as day-month-year |
| 107 | */ |
| 108 | std::string get_formatted() NOEXCEPT; |
| 109 | private: |
| 110 | /** |
| 111 | * The day for this date. |
| 112 | */ |
| 113 | unsigned int day; |
| 114 | /** |
| 115 | * The month name. |
| 116 | */ |
nothing calls this directly
no outgoing calls
no test coverage detected