mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd::fs::path: Use scoped enum for fs::path::base paths.
This commit is contained in:
parent
c20e4bccd4
commit
82a7d736d1
5 changed files with 12 additions and 12 deletions
|
@ -19,7 +19,7 @@ namespace boost::filesystem
|
|||
|
||||
namespace ircd::fs
|
||||
{
|
||||
enum base :uint;
|
||||
enum class base :uint;
|
||||
struct basepath;
|
||||
using path_view = vector_view<const string_view>;
|
||||
using path_strings = vector_view<const std::string>;
|
||||
|
@ -77,7 +77,7 @@ struct ircd::fs::basepath
|
|||
/// Note that even though the PREFIX is accessible here, custom installations
|
||||
/// may use entirely different paths for other components; most installations
|
||||
/// use the package-target name as a path component.
|
||||
enum ircd::fs::base
|
||||
enum class ircd::fs::base
|
||||
:uint
|
||||
{
|
||||
PREFIX, ///< Installation prefix (from ./configure --prefix)
|
||||
|
|
12
ircd/db.cc
12
ircd/db.cc
|
@ -163,7 +163,7 @@ try
|
|||
{
|
||||
const auto dbdir
|
||||
{
|
||||
fs::path(fs::DB)
|
||||
fs::path(fs::base::DB)
|
||||
};
|
||||
|
||||
if(!fs::is_dir(dbdir) && (ircd::read_only || ircd::write_avoid))
|
||||
|
@ -212,7 +212,7 @@ try
|
|||
{
|
||||
log, "Direct-IO is not supported in the database directory `%s'"
|
||||
"; Concurrent database queries will not be possible.",
|
||||
fs::basepath::get(fs::DB)
|
||||
fs::basepath::get(fs::base::DB)
|
||||
};
|
||||
}
|
||||
catch(const std::exception &e)
|
||||
|
@ -234,7 +234,7 @@ ircd::db::direct_io_test_file_path()
|
|||
"SUPPORTS_DIRECT_IO"_sv
|
||||
};
|
||||
|
||||
return fs::path_string(fs::DB, test_file_name);
|
||||
return fs::path_string(fs::base::DB, test_file_name);
|
||||
}
|
||||
|
||||
namespace rocksdb::crc32c
|
||||
|
@ -3468,7 +3468,7 @@ ircd::db::database::sst::dump::dump(db::column column,
|
|||
{
|
||||
const string_view path_parts[]
|
||||
{
|
||||
fs::path(fs::DB), db::name(d), db::name(c)
|
||||
fs::path(fs::base::DB), db::name(d), db::name(c)
|
||||
};
|
||||
|
||||
path = fs::path_string(path_parts);
|
||||
|
@ -7579,7 +7579,7 @@ ircd::db::available()
|
|||
{
|
||||
const auto &prefix
|
||||
{
|
||||
fs::path(fs::DB)
|
||||
fs::path(fs::base::DB)
|
||||
};
|
||||
|
||||
const auto dirs
|
||||
|
@ -7643,7 +7643,7 @@ ircd::db::path(const string_view &name,
|
|||
{
|
||||
const auto &prefix
|
||||
{
|
||||
fs::path(fs::DB)
|
||||
fs::path(fs::base::DB)
|
||||
};
|
||||
|
||||
const string_view parts[]
|
||||
|
|
|
@ -134,7 +134,7 @@ ircd::log::mkdir()
|
|||
{
|
||||
const auto &dir
|
||||
{
|
||||
fs::path(fs::LOG)
|
||||
fs::path(fs::base::LOG)
|
||||
};
|
||||
|
||||
if(fs::exists(dir))
|
||||
|
@ -211,7 +211,7 @@ catch(const std::exception &e)
|
|||
std::string
|
||||
ircd::log::file_path(const level &lev)
|
||||
{
|
||||
return fs::path_string(fs::LOG, reflect(lev));
|
||||
return fs::path_string(fs::base::LOG, reflect(lev));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1095,7 +1095,7 @@ catch(const boost::system::system_error &e)
|
|||
decltype(ircd::mods::prefix)
|
||||
ircd::mods::prefix
|
||||
{
|
||||
fs::path(fs::MODULES)
|
||||
fs::path(fs::base::MODULES)
|
||||
};
|
||||
|
||||
decltype(ircd::mods::suffix)
|
||||
|
|
|
@ -4004,7 +4004,7 @@ console_cmd__db__list(opt &out, const string_view &line)
|
|||
{
|
||||
const auto name
|
||||
{
|
||||
replace(lstrip(lstrip(path, fs::path(fs::DB)), '/'), "/", ":")
|
||||
replace(lstrip(lstrip(path, fs::path(fs::base::DB)), '/'), "/", ":")
|
||||
};
|
||||
|
||||
const auto &d
|
||||
|
|
Loading…
Reference in a new issue