8 #include <boost/filesystem.hpp> 17 bool oExistSQLDBDir =
false;
20 boost::filesystem::path lSQLiteDBFullPath (iSQLDBConnStr.begin(),
24 boost::filesystem::path lSQLiteDBParentPath =
25 lSQLiteDBFullPath.parent_path();
28 oExistSQLDBDir = boost::filesystem::exists (lSQLiteDBParentPath)
29 && boost::filesystem::is_directory (lSQLiteDBParentPath);
31 return oExistSQLDBDir;
37 bool oExistXapianDBDir =
false;
40 boost::filesystem::path lTravelDBFilePath (iTravelDBFilePath.begin(),
41 iTravelDBFilePath.end());
44 oExistXapianDBDir = boost::filesystem::exists (lTravelDBFilePath)
45 && boost::filesystem::is_directory (lTravelDBFilePath);
47 return oExistXapianDBDir;
54 boost::filesystem::path lTravelDBFilePath (iTravelDBFilePath.begin(),
55 iTravelDBFilePath.end());
58 <<
"') will be cleared");
59 boost::filesystem::remove_all (lTravelDBFilePath);
62 boost::filesystem::create_directories (lTravelDBFilePath);
65 if (!(boost::filesystem::exists (lTravelDBFilePath)
66 && boost::filesystem::is_directory (lTravelDBFilePath))) {
67 std::ostringstream oStr;
68 oStr <<
"The directory for the Xapian database/index ('" 69 << lTravelDBFilePath <<
"') cannot be created; check file-system " 70 <<
"permissions and whether the file-system is writable";
#define OPENTREP_LOG_ERROR(iToBeLogged)
#define OPENTREP_LOG_DEBUG(iToBeLogged)
static bool checkXapianDBOnFileSystem(const TravelDBFilePath_T &)
static bool checkSQLiteDirectory(const std::string &iSQLDBConnStr)
static void recreateXapianDirectory(const std::string &iTravelDBFilePath)