OSDN Git Service

create_tableの関数をお試し実装?(途中)
authorMyun2 <myun2@nwhite.info>
Thu, 19 Apr 2012 00:56:03 +0000 (09:56 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 19 Apr 2012 00:56:03 +0000 (09:56 +0900)
roast/include/roast/db/sql/create_table_detail.hpp
roast/include/roast/db/sql/table.hpp

index a203b37..3e638b8 100644 (file)
@@ -7,6 +7,7 @@
 #define __SFJP_ROAST__db__sql__create_table_detail_HPP__
 
 #include "roast/db/sql/sql_common.hpp"
+#include <string>
 #include <vector>
 
 namespace roast
@@ -57,7 +58,16 @@ namespace roast
                class _if_not_exists<false> : public empty
                {
                };
-
+               
+               ///////////////////////////////////////////////////////////////////////////
+               
+               class create_table_tablename : public ::std::string
+               {
+               public:
+                       create_table_tablename(){}
+                       create_table_tablename(const char* s): ::std::string(s){}
+                       create_table_tablename(const ::std::string& s): ::std::string(s){}
+               };
                
                ///////////////////////////////////////////////////////////////////////////
        }
index f3ee340..ef57dc5 100644 (file)
@@ -24,13 +24,22 @@ namespace roast
                        _op_names::table, _char::space, _if_not_exists<_IsExistNoError>,        //      TABLE [IF NOT EXISTS]
                        TABLE_NAME, _char::space, _char::lpare, COLUMNS, _char::rpare>          //      <TABLE NAME> (<COLUMNS>)
                {
+               private:
+                       const TABLE_NAME m_tblname;
+                       const COLUMNS m_columns;
+               public:
+                       create_table_(){};
+                       create_table_(const TABLE_NAME &tblname, const COLUMNS& columns):
+                               m_tblname(tblname), m_columns(columns){};
                };
 
-               /*create_table_<::std::string, create_table_columns>
+               create_table_<create_table_tablename, create_table_columns>
                        create_table(const char* table_name, const create_table_columns& columns,
                                bool is_temporary=false, bool is_exist_no_error=false)
                {
-               }*/
+                       return create_table_<create_table_tablename, create_table_columns>(
+                               create_table_tablename(table_name), columns);
+               }
                
                ///////////////////////////////////////////////////////////////////////////////////