本文整理汇总了C++中Table::addEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ Table::addEntry方法的具体用法?C++ Table::addEntry怎么用?C++ Table::addEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table::addEntry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, const char* argv[])
{
cout << "DBMS started.\n";
Database database = Database();
vector<string> columnNames;
columnNames.push_back("Names");
columnNames.push_back("Ages");
Table first = Table("DiffTest1", columnNames, 2);
//Table second = Table("DiffTest2", 2);
vector<string> firstEntVec;
firstEntVec.push_back("Bob");
firstEntVec.push_back("1");
first.addEntry(Entry(firstEntVec));
first.printTable();
//to be added later -WB
//database.addTable(first);
//database.addTable(second);
//difference (will uncomment once Table has fixed compile errors)
//Table diff = database.differences(first, second);
cout << "\n\n";
system("PAUSE");
}
示例2: initialize
//helper function
Table initialize(){
vector < string > in;
string input = " ";
int i = 0;
Table t;
ifstream fin("database.txt",ios::in);
while(fin.good()){
getline(fin, input, '|');
if(input == "[()]" && i == 0){
Table q(in);
for(int q = 0; q<in.size(); q++)
cout << in[q] <<endl;
in.clear();
t = q;
i++;
}
else if(input == "[()]"){ // [()] is the end of line delimeter
t.addEntry(in);
for(int q = 0; q<in.size(); q++)
cout << in[q] <<endl;
in.clear();
}
else
in.push_back(input);
}
fin.close();
return t;
}
示例3: main
int main(int argc, char *argv[])
{
GetOption get_option(argc, argv);
string config_file = "";
get_option.getOption("config", config_file);
YamlConfig *app_config = new YamlConfig(config_file);
database_config = new ConnectionDetails(*app_config);
conn_config = database_config;
yamlConfig = app_config;
s_pwd = helper.getPWD(argv[0], "./");
initialize_logger(*app_config);
#ifdef WATCHLIST_MYSQL
cout << "compiled for mysql " << endl;
#endif
initConnectionPool();
Table *WatchObj = new Table("watchlists");
Record new_record;
new_record.addColumn("account_id", "001", field::TYPE_STRING, 64);
new_record.addColumn("name", "WATCH001", field::TYPE_STRING, 64);
WatchObj->print_status();
cout << "size: " << new_record.getLength() << endl;
WatchObj->addEntry(new_record);
vector<field> fields;
vector<condition> conditions;
ADD_TO_FIELDS("name", field::TYPE_STRING, 64, fields) // setting the fields for variable binding
ADD_TO_FIELDS("id", field::TYPE_STRING, 64, fields)
ADD_TO_FIELDS("account_id", field::TYPE_STRING, 64, fields)
ADD_TO_CONDITIONS("account_id",field::TYPE_STRING,"001",conditions)
ADD_TO_CONDITIONS("name",field::TYPE_STRING,"test_watch1234",conditions)
WatchObj->print_status();
WatchObj->select(fields,conditions);
WatchObj->print_status();
delete WatchObj;
delete logger;
delete app_config;
delete database_config;
return 0;
}