updated build system
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
This commit is contained in:
parent
4a2acf99a7
commit
d6b2c1d81e
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
static auto get_source_file_name() -> std::string {
|
static auto get_source_file_name() -> std::string {
|
||||||
return generate_test_file_name(get_test_dir(), "encrypting_reader");
|
return generate_test_file_name("./test_data", "encrypting_reader");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(encrypting_reader, get_encrypted_file_name) {
|
TEST(encrypting_reader, get_encrypted_file_name) {
|
||||||
|
15
support/3rd_party/include/utils/file.hpp
vendored
15
support/3rd_party/include/utils/file.hpp
vendored
@ -64,7 +64,8 @@ public:
|
|||||||
|
|
||||||
[[nodiscard]] auto read(data_buffer &data, std::uint64_t offset,
|
[[nodiscard]] auto read(data_buffer &data, std::uint64_t offset,
|
||||||
std::size_t *total_read = nullptr) -> bool {
|
std::size_t *total_read = nullptr) -> bool {
|
||||||
return read(data.data(), data.size(), offset, total_read);
|
return read_(reinterpret_cast<unsigned char *>(data.data()), data.size(),
|
||||||
|
offset, total_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] auto remove() -> bool;
|
[[nodiscard]] auto remove() -> bool;
|
||||||
@ -76,24 +77,26 @@ public:
|
|||||||
#if defined(PROJECT_ENABLE_JSON)
|
#if defined(PROJECT_ENABLE_JSON)
|
||||||
[[nodiscard]] auto write(const nlohmann::json &data, std::uint64_t offset,
|
[[nodiscard]] auto write(const nlohmann::json &data, std::uint64_t offset,
|
||||||
std::size_t *total_written = nullptr) -> bool {
|
std::size_t *total_written = nullptr) -> bool {
|
||||||
return write(data.dump().c_str(), offset, total_written);
|
return write_(reinterpret_cast<const unsigned char *>(data.dump().c_str()),
|
||||||
|
offset, total_written);
|
||||||
}
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_JSON)
|
#endif // defined(PROJECT_ENABLE_JSON)
|
||||||
|
|
||||||
[[nodiscard]] auto write(const data_buffer &data, std::uint64_t offset,
|
[[nodiscard]] auto write(const data_buffer &data, std::uint64_t offset,
|
||||||
std::size_t *total_written = nullptr) -> bool {
|
std::size_t *total_written = nullptr) -> bool {
|
||||||
return write(data.data(), data.size(), offset, total_written);
|
return write_(reinterpret_cast<const unsigned char *>(data.data()),
|
||||||
|
data.size(), offset, total_written);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] operator bool() const { return stream_.is_open(); }
|
[[nodiscard]] operator bool() const { return stream_.is_open(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
[[nodiscard]] auto read(unsigned char *data, std::size_t to_read,
|
[[nodiscard]] auto read_(unsigned char *data, std::size_t to_read,
|
||||||
std::uint64_t offset,
|
std::uint64_t offset,
|
||||||
std::size_t *total_read) -> bool;
|
std::size_t *total_read) -> bool;
|
||||||
|
|
||||||
[[nodiscard]] auto write(const typename data_buffer::value_type *data,
|
[[nodiscard]] auto write_(const unsigned char *data, std::size_t to_write,
|
||||||
std::size_t to_write, std::size_t offset,
|
std::size_t offset,
|
||||||
std::size_t *total_written) -> bool;
|
std::size_t *total_written) -> bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
support/3rd_party/src/utils/file.cpp
vendored
4
support/3rd_party/src/utils/file.cpp
vendored
@ -87,7 +87,7 @@ auto file::move_to(std::filesystem::path new_path) -> bool {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto file::read(unsigned char *data, std::size_t to_read, std::uint64_t offset,
|
auto file::read_(unsigned char *data, std::size_t to_read, std::uint64_t offset,
|
||||||
std::size_t *total_read) -> bool {
|
std::size_t *total_read) -> bool {
|
||||||
static constexpr const std::string_view function_name{
|
static constexpr const std::string_view function_name{
|
||||||
static_cast<const char *>(__FUNCTION__),
|
static_cast<const char *>(__FUNCTION__),
|
||||||
@ -145,7 +145,7 @@ auto file::truncate(std::size_t size) -> bool {
|
|||||||
return not error_;
|
return not error_;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto file::write(const typename data_buffer::value_type *data,
|
auto file::write_(const typename data_buffer::value_type *data,
|
||||||
std::size_t to_write, std::size_t offset,
|
std::size_t to_write, std::size_t offset,
|
||||||
std::size_t *total_written) -> bool {
|
std::size_t *total_written) -> bool {
|
||||||
static constexpr const std::string_view function_name{
|
static constexpr const std::string_view function_name{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user