27 #include <sys/types.h>
37 DBStatementCatalog* DBStatementCatalog::aInstance =
nullptr;
39 bool DBStatementCatalog::load() {
51 if ((vDir = opendir (aPath.c_str())) !=
nullptr) {
52 while ((vDirEnt = readdir (vDir)) !=
nullptr) {
53 size_t vLen = strlen(vDirEnt->d_name);
55 if (strcmp(vDirEnt->d_name+vLen-4,
".sql")==0) {
56 strncpy(vName,vDirEnt->d_name,vLen-4);
60 vFilePath.append(
"/");
61 vFilePath.append(vDirEnt->d_name);
63 vFile.open(vFilePath.c_str(),ios::in);
66 while (getline(vFile,vLine)) {
73 aCatalog.put(vName,vValue);