feat(archive): add streaming Reader, atomic StagedTree publication, reproducible creation, and isolated worker
This commit is contained in:
1 parent
713d2dc656
commit
00d7478335
10 files changed
+3781
-5
No files matched your search
@@ -0,0 +1,11 @@
|
||||
cmake_minimum_required(VERSION 4.0)
|
||||
project(VoidArchiveOnlyConsumer LANGUAGES CXX)
|
||||
|
||||
find_package(Void CONFIG REQUIRED COMPONENTS Archive)
|
||||
|
||||
add_executable(void_archive_only_consumer main.cpp)
|
||||
target_link_libraries(void_archive_only_consumer PRIVATE Void::Archive)
|
||||
target_compile_features(void_archive_only_consumer PRIVATE cxx_std_26)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME ArchiveOnlyConsumer COMMAND void_archive_only_consumer)
|
||||
@@ -0,0 +1,26 @@
|
||||
#include <Void/Archive/Archive.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
|
||||
int main()
|
||||
{
|
||||
const std::array<Void::Archive::CreateEntry, 1> entries{{
|
||||
Void::Archive::CreateEntry{
|
||||
.path = "hello.txt",
|
||||
.type = Void::Archive::EntryType::RegularFile,
|
||||
.content = {std::byte{'h'}, std::byte{'i'}},
|
||||
},
|
||||
}};
|
||||
Void::Archive::VectorByteSink sink;
|
||||
if (!Void::Archive::create_archive(sink, entries).has_value()) {
|
||||
return 1;
|
||||
}
|
||||
Void::Archive::SpanByteSource src{sink.bytes()};
|
||||
auto listed = Void::Archive::list_entries(src);
|
||||
if (!listed.has_value() || listed->size() != 1U ||
|
||||
(*listed)[0].path != "hello.txt") {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user