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 {
|
||||
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) {
|
||||
|
21
support/3rd_party/include/utils/file.hpp
vendored
21
support/3rd_party/include/utils/file.hpp
vendored
@ -64,7 +64,8 @@ public:
|
||||
|
||||
[[nodiscard]] auto read(data_buffer &data, std::uint64_t offset,
|
||||
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;
|
||||
@ -76,25 +77,27 @@ public:
|
||||
#if defined(PROJECT_ENABLE_JSON)
|
||||
[[nodiscard]] auto write(const nlohmann::json &data, std::uint64_t offset,
|
||||
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)
|
||||
|
||||
[[nodiscard]] auto write(const data_buffer &data, std::uint64_t offset,
|
||||
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(); }
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto read(unsigned char *data, std::size_t to_read,
|
||||
std::uint64_t offset,
|
||||
std::size_t *total_read) -> bool;
|
||||
[[nodiscard]] auto read_(unsigned char *data, std::size_t to_read,
|
||||
std::uint64_t offset,
|
||||
std::size_t *total_read) -> bool;
|
||||
|
||||
[[nodiscard]] auto write(const typename data_buffer::value_type *data,
|
||||
std::size_t to_write, std::size_t offset,
|
||||
std::size_t *total_written) -> bool;
|
||||
[[nodiscard]] auto write_(const unsigned char *data, std::size_t to_write,
|
||||
std::size_t offset,
|
||||
std::size_t *total_written) -> bool;
|
||||
};
|
||||
|
||||
[[nodiscard]] auto get_file_size(std::string_view path,
|
||||
|
10
support/3rd_party/src/utils/file.cpp
vendored
10
support/3rd_party/src/utils/file.cpp
vendored
@ -87,8 +87,8 @@ auto file::move_to(std::filesystem::path new_path) -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto file::read(unsigned char *data, std::size_t to_read, std::uint64_t offset,
|
||||
std::size_t *total_read) -> 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__),
|
||||
};
|
||||
@ -145,9 +145,9 @@ auto file::truncate(std::size_t size) -> bool {
|
||||
return not error_;
|
||||
}
|
||||
|
||||
auto file::write(const typename data_buffer::value_type *data,
|
||||
std::size_t to_write, std::size_t offset,
|
||||
std::size_t *total_written) -> bool {
|
||||
auto file::write_(const typename data_buffer::value_type *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__),
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user