#ifndef TABLE_HPP
#define TABLE_HPP
#include <vector>
#include <map>
#include <string>
namespace sqlpp
{
typedef std::vector<std::string> field_list;
typedef std::map<int, std::string> row_digit;
typedef std::map<std::string, std::string> row_string;
class Table
{
public:
Table(const std::string& create_cmd);
virtual ~Table();
std::vector<row_digit>& get_rows(void)throw();
std::vector<row_string>& get_rows_index_string(void)throw();
field_list& get_fields(void)throw();
const std::string& get_create_cmd(void)const throw();
const std::vector<std::string>& get_update_cmds(void)const throw();
protected:
private:
const Table& operator=(const Table& rh);
Table(const Table& rh);
void trans_to_digit(void)throw();//trans row index to digit
void trans_to_string(void)throw();//trans row index to string
//create,modify,update table sql cmd list;
std::vector<std::string> _update_cmds;
std::vector<row_digit> _rows;
std::vector<row_string> _rows_string;
field_list _fields;
std::string _create_cmd;
bool _index_is_string;
};
};
#endif
#define TABLE_HPP
#include <vector>
#include <map>
#include <string>
namespace sqlpp
{
typedef std::vector<std::string> field_list;
typedef std::map<int, std::string> row_digit;
typedef std::map<std::string, std::string> row_string;
class Table
{
public:
Table(const std::string& create_cmd);
virtual ~Table();
std::vector<row_digit>& get_rows(void)throw();
std::vector<row_string>& get_rows_index_string(void)throw();
field_list& get_fields(void)throw();
const std::string& get_create_cmd(void)const throw();
const std::vector<std::string>& get_update_cmds(void)const throw();
protected:
private:
const Table& operator=(const Table& rh);
Table(const Table& rh);
void trans_to_digit(void)throw();//trans row index to digit
void trans_to_string(void)throw();//trans row index to string
//create,modify,update table sql cmd list;
std::vector<std::string> _update_cmds;
std::vector<row_digit> _rows;
std::vector<row_string> _rows_string;
field_list _fields;
std::string _create_cmd;
bool _index_is_string;
};
};
#endif