-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbc.cpp
More file actions
31 lines (29 loc) · 1017 Bytes
/
dbc.cpp
File metadata and controls
31 lines (29 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "dbc.h"
#include "ioc.h"
#include <filesystem>
#include <iostream>
using namespace std;
namespace fs = filesystem;
void DbcToSql() {
fs::path current = getCurrentPath() / "dbc";
if (!fs::exists(current)) {
cout << current << " is not exists, create it and move according files into it!" << endl;
if (!fs::create_directories(current)) {
cout << "create_directories " << current << " error!" << endl;
}
return ;
}
for (auto& i : filesystem::directory_iterator(current)) {
auto dbcStr = i.path().string();
auto dbcFileName = i.path().filename().string();
cout << "-------------find " << dbcFileName << endl;
string dbcName = dbcFileName.erase(dbcFileName.find("."));
auto dbc = GetInstance(dbcName.c_str());
if (!dbc) {
cout << " [Err]" << dbcName << ".h & " << dbcName << ".cpp is not linked!" << endl;
continue;
}
dbc->Load();
dbc->DumpSql();
}
}