| 16 | |
| 17 | namespace hadmap { |
| 18 | LocalSearch::LocalSearch(MAP_DATA_TYPE type, const std::string& path) |
| 19 | : dbPath(path), dbPtr(NULL), dbType(type), optInfo("") { |
| 20 | optInfo = std::string("Load DB Failed"); |
| 21 | |
| 22 | if (dbType == SQLITE) { |
| 23 | dbPtr = dbFactory::getInstance()->getSqliteOp(dbPath); |
| 24 | if (dbPtr->connect() && dbPtr->initialize()) { |
| 25 | optInfo = std::string("Load DB successful"); |
| 26 | } else { |
| 27 | dbFactory::getInstance()->releaseDB(&dbPtr); |
| 28 | dbPtr = NULL; |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | LocalSearch::~LocalSearch() { |
| 34 | if (dbPtr == NULL) { |
nothing calls this directly
no test coverage detected