Add database dir and file fns to SparkDataDirectory
This commit is contained in:
1 parent
345b76257b
commit
f23c7af88c
2 files changed
+20
No files matched your search
@@ -28,4 +28,19 @@ boost::filesystem::path SparkDataDirectory::log_cache_file() const {
|
||||
return log_dir() / "log_cache";
|
||||
}
|
||||
|
||||
boost::filesystem::path SparkDataDirectory::database_dir(
|
||||
const std::string &name) const {
|
||||
return root_ / "databases" / (name + "/");
|
||||
}
|
||||
|
||||
boost::filesystem::path SparkDataDirectory::database_file(
|
||||
const std::string &name) const {
|
||||
return root_ / "databases" / name / (name + ".sqlite");
|
||||
}
|
||||
|
||||
boost::filesystem::path SparkDataDirectory::database_file(
|
||||
const std::string &dir_name, const std::string &db_name) const {
|
||||
return root_ / "databases" / dir_name / (db_name + ".sqlite");
|
||||
}
|
||||
|
||||
} // namespace bts::spark
|
||||
@@ -16,6 +16,11 @@ class SparkDataDirectory {
|
||||
boost::filesystem::path log_file() const;
|
||||
boost::filesystem::path log_cache_file() const;
|
||||
|
||||
boost::filesystem::path database_dir(const std::string &name) const;
|
||||
boost::filesystem::path database_file(const std::string &name) const;
|
||||
boost::filesystem::path database_file(
|
||||
const std::string &dir_name, const std::string &db_name) const;
|
||||
|
||||
private:
|
||||
boost::filesystem::path root_;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user