Advertisement
iwishiknew

chrono_date.h

Jul 28th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.19 KB | None | 0 0
  1. #ifndef T_EXTRA_H_INCLUDED
  2. #define T_EXTRA_H_INCLUDED
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. //type to represent the time
  8. typedef string chronoT;
  9.  
  10. /**Note: Only variables can be used to set static defaults*/
  11.  
  12. class chrono_date{
  13. public:
  14.  
  15.     //constructors:
  16.     chrono_date();
  17.     chrono_date(const string&);
  18.     chrono_date(const char*);
  19.    
  20.     //destructor:
  21.     ~chrono_date();
  22.    
  23.     //handy dandy functions...
  24.     int hour();
  25.     int minute();
  26.     int second();
  27.     string day_of_week();
  28.     int num_day_of_week();
  29.     int day_of_month();
  30.     int month_number();
  31.     string month_name();
  32.     int year();
  33.     string week_day_id_name(const int&);
  34.     bool is_past(const string&);
  35.  
  36.     //some more appropriate time display functions:
  37.     int std_hour();
  38.     int std_minute();
  39.     string std_ampm();
  40.     string std_time_disp();
  41.  
  42.     //day identification
  43.     int day_number();
  44.     void set_day_id(const int&);
  45.  
  46.     int year_v = chrono_date::year();
  47.    
  48.     void reset();
  49.    
  50.     //getter:
  51.     const string gasc_time();
  52.  
  53. private:
  54.     string t();
  55.     bool is_leap_year(const int&);
  56.    
  57.     chronoT asc_time;
  58.  
  59. };
  60.  
  61. #endif // T_EXTRA_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement