|
@@ -47,7 +47,7 @@ ExistTables* ExistTables::read_from_file() {
|
|
|
std::ifstream f(table_file_name);
|
|
|
json j = json::parse(f);
|
|
|
for (auto& item : j.items()) {
|
|
|
- tables[item.key()] = item.value().get<std::vector<std::string>>();
|
|
|
+ tables[item.key()] = item.value();
|
|
|
}
|
|
|
return this;
|
|
|
};
|
|
@@ -55,12 +55,8 @@ ExistTables* ExistTables::read_from_file() {
|
|
|
bool ExistTables::exists(const std::string& table_name) {
|
|
|
return tables.find(table_name) != tables.end();
|
|
|
}
|
|
|
-void ExistTables::set(const std::string& table_name,
|
|
|
- const std::vector<std::string>& cols) {
|
|
|
- std::vector<std::string> to_vector;
|
|
|
- std::copy(cols.begin(), cols.end(), std::back_inserter(to_vector));
|
|
|
-
|
|
|
- tables[table_name] = to_vector;
|
|
|
+void ExistTables::set(const std::string& table_name, const TableCols& cols) {
|
|
|
+ tables[table_name] = cols;
|
|
|
}
|
|
|
void ExistTables::remove(const std::string& table_name) {
|
|
|
tables.erase(table_name);
|