From: Myun2 Date: Thu, 19 Apr 2012 00:56:03 +0000 (+0900) Subject: create_tableの関数をお試し実装?(途中) X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e3d647337b9d0351b38f18b8c6bfe8078593b9d5;p=roast%2Froast.git create_tableの関数をお試し実装?(途中) --- diff --git a/roast/include/roast/db/sql/create_table_detail.hpp b/roast/include/roast/db/sql/create_table_detail.hpp index a203b376..3e638b83 100644 --- a/roast/include/roast/db/sql/create_table_detail.hpp +++ b/roast/include/roast/db/sql/create_table_detail.hpp @@ -7,6 +7,7 @@ #define __SFJP_ROAST__db__sql__create_table_detail_HPP__ #include "roast/db/sql/sql_common.hpp" +#include #include namespace roast @@ -57,7 +58,16 @@ namespace roast class _if_not_exists : 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){} + }; /////////////////////////////////////////////////////////////////////////// } diff --git a/roast/include/roast/db/sql/table.hpp b/roast/include/roast/db/sql/table.hpp index f3ee3408..ef57dc5d 100644 --- a/roast/include/roast/db/sql/table.hpp +++ b/roast/include/roast/db/sql/table.hpp @@ -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> // () { + 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(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(table_name), columns); + } ///////////////////////////////////////////////////////////////////////////////////