OSDN Git Service

unixtime.hpp 実装
authorMyun2 <myun2@nwhite.info>
Mon, 30 Apr 2012 17:03:11 +0000 (02:03 +0900)
committerMyun2 <myun2@nwhite.info>
Mon, 30 Apr 2012 17:04:03 +0000 (02:04 +0900)
roast/include/roast/time.hpp [new file with mode: 0644]
roast/include/roast/time/time.hpp [new file with mode: 0644]
roast/include/roast/time/unixtime.hpp
roast/test/roast_test_3rd/roast_test_3rd.vcproj

diff --git a/roast/include/roast/time.hpp b/roast/include/roast/time.hpp
new file mode 100644 (file)
index 0000000..b55cf0e
--- /dev/null
@@ -0,0 +1,10 @@
+//     Roast+ License
+
+/*
+*/
+#ifndef __SFJP_ROAST__time_HPP__
+#define __SFJP_ROAST__time_HPP__
+
+#include "roast/time/time.hpp"
+
+#endif//__SFJP_ROAST__time_HPP__
diff --git a/roast/include/roast/time/time.hpp b/roast/include/roast/time/time.hpp
new file mode 100644 (file)
index 0000000..7f71f5f
--- /dev/null
@@ -0,0 +1,10 @@
+//     Roast+ License
+/*
+       
+*/
+#ifndef __SFJP_ROAST__time__time_HPP__
+#define __SFJP_ROAST__time__time_HPP__
+
+#include "roast/time/unixtime.hpp"
+
+#endif//__SFJP_ROAST__time__time_HPP__
\ No newline at end of file
index 9c1b04c..11ffeb0 100644 (file)
@@ -11,10 +11,24 @@ namespace roast
 {
        ///////////////////////////////////////////////////////////////
        
-       class datetime
+       typedef ::time_t unix_time_t, unix_time_type;
+       
+       unix_time_type get_unix_time_now(){
+               return ::time(NULL);
+       }
+       
+       ///////////////////////////////////////////////////////////////
+       
+       class unix_time
        {
+       protected:
+               unix_time_type m_time;
        public:
-               datetime(){]
+               unix_time(){ m_time = get_unix_time_now(); }
+               unix_time(const unix_time_type& tm) : m_time(tm) {}
+               
+               unix_time_type get_time() const { return m_time; }
+               void set_time(const unix_time_type& tm) { m_time = tm; }
        };
        
        ///////////////////////////////////////////////////////////////
index 9548487..d224a3f 100644 (file)
                        UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
                        >
                        <File
-                               RelativePath=".\tuple_test3.cpp"
+                               RelativePath=".\time_test.cpp"
                                >
                        </File>
                </Filter>