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;
|
||||
}
|
||||
@@ -197,6 +197,15 @@ if(_has_security_async)
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_SQLite3=TRUE)
|
||||
endif()
|
||||
|
||||
has_modules(_has_archive Archive System Time Functional)
|
||||
if(_has_archive)
|
||||
run_consumer(ArchiveOnly "${install_prefix}" "ArchiveOnly"
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=TRUE
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_SQLite3=TRUE)
|
||||
endif()
|
||||
|
||||
# Foundation consumer with Core-formatting bridge and zero external packages.
|
||||
has_modules(_has_foundation Math Text Time Functional Binary FunctionalCoreFormatting Memory Core)
|
||||
if(_has_foundation)
|
||||
|
||||
Reference in new issue
Block a user