CrossFramework Library

XBase/Calendar.hpp

説明を見る。
00001 
00006 #if defined(XBASE_INCLUDED_CALENDAR_HPP)
00007 #else
00008 #define XBASE_INCLUDED_CALENDAR_HPP
00009 
00010 //------------------------------------------------------------
00011 #include <XBase/BuiltInTypes.hpp>
00012 #include <XBase/PODInheritClass.hpp>
00013 
00014 //------------------------------------------------------------
00015 namespace XBase {
00017 
00018 
00022     struct CalendarPOD
00023     {
00025 
00026         enum 
00027         {
00028             YearMin =  0,       
00029             YearMax =  9998,    
00030             MonthMin = 0,       
00031             MonthMax = 11,      
00032             DayOfYearMin = 0,   
00033             DayOfYearMax = 365, 
00034             DayOfMonthMin = 0,  
00035             DayOfMonthMax = 30, 
00036             DayOfWeekMin = 0,   
00037             DayOfWeekMax = 6,   
00038             HourMin = 0,        
00039             HourMax = 23,       
00040             MinuteMin = 0,      
00041             MinuteMax = 59,     
00042             SecondMin = 0,      
00043             SecondMax = 59,     
00044             MillisecondMin = 0,     
00045             MillisecondMax = 999,   
00046             MicrosecondMin = 0,     
00047             MicrosecondMax = 999,   
00048             NanosecondsMin = 0,     
00049             NanosecondsMax = 999,   
00050             FirstDayOfWeek = 1      
00051         };
00053 
00059         static bool IsLeapYear( uint aYear );
00060 
00068         static uint DaysToDate( uint aYear , uint aMonth , uint aDayOfMonth );
00069 
00075         static const CalendarPOD FromDays( uint aDays );
00076 
00082         static uint  DaysInYear( uint aYear );
00083 
00090         static uint  DaysInMonth( uint aYear , uint aMonth );
00091 
00092         u16 year;       
00093         u16 month;      
00094         u16 dayOfYear;  
00095         u16 dayOfMonth; 
00096         u16 dayOfWeek;  
00097         u16 hour;       
00098         u16 min;        
00099         u16 sec;        
00100         u16 msec;       
00101         u16 usec;       
00102         u16 nsec;       
00103     };
00104 
00106     typedef PODInheritClass< CalendarPOD > Calendar;
00108 }
00109 //------------------------------------------------------------
00110 #endif
00111 // EOF
 全て クラス ネームスペース ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義