updated build system

This commit is contained in:
2024-10-17 11:18:08 -05:00
parent 0bd7070ec5
commit d192904f8c
42 changed files with 975 additions and 1670 deletions

View File

@@ -64,9 +64,7 @@ namespace {
namespace repertory::utils::file {
// auto file::attach_file(native_handle handle,
// bool read_only) -> fs_file_t {
// static constexpr const std::string_view function_name{
// static_cast<const char *>(__FUNCTION__),
// };
// REPERTORY_USES_FUNCTION_NAME();
//
// try {
// std::string path;
@@ -132,9 +130,7 @@ void file::open() {
}
auto file::open_file(std::string_view path, bool read_only) -> fs_file_t {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
auto *ptr = new file{
nullptr,
@@ -188,9 +184,7 @@ auto file::open_or_create_file(std::string_view path, bool read_only)
void file::close() { file_.reset(); }
auto file::copy_to(std::string_view new_path, bool overwrite) const -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
try {
auto to_path = utils::path::absolute(new_path);
@@ -238,9 +232,7 @@ auto file::get_handle() const -> native_handle {
}
auto file::is_symlink() const -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
try {
return std::filesystem::is_symlink(path_);
@@ -254,9 +246,7 @@ auto file::is_symlink() const -> bool {
}
auto file::move_to(std::string_view path) -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
auto abs_path = utils::path::absolute(path);
@@ -296,9 +286,7 @@ auto file::move_to(std::string_view path) -> bool {
auto file::read(unsigned char *data, std::size_t to_read, std::uint64_t offset,
std::size_t *total_read) -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
if (total_read != nullptr) {
(*total_read) = 0U;
@@ -345,9 +333,7 @@ auto file::read(unsigned char *data, std::size_t to_read, std::uint64_t offset,
#if defined(PROJECT_ENABLE_LIBSODIUM)
auto file::sha256() -> std::optional<std::string> {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
auto should_close{false};
auto read_only{read_only_};
@@ -428,9 +414,7 @@ auto file::remove() -> bool {
}
auto file::truncate(std::size_t size) -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
auto reopen{false};
if (file_) {
@@ -460,9 +444,7 @@ auto file::truncate(std::size_t size) -> bool {
auto file::write(const unsigned char *data, std::size_t to_write,
std::size_t offset, std::size_t *total_written) -> bool {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
if (total_written != nullptr) {
(*total_written) = 0U;
@@ -510,9 +492,7 @@ auto file::write(const unsigned char *data, std::size_t to_write,
}
auto file::size() const -> std::optional<std::uint64_t> {
static constexpr const std::string_view function_name{
static_cast<const char *>(__FUNCTION__),
};
REPERTORY_USES_FUNCTION_NAME();
try {
if (file_) {