From 81c2e0ac8e76ddb3fd3c8e2ce59929853614b1b6 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Wed, 11 Sep 2024 00:27:39 -0700 Subject: archive: rename ParseSink to NARParseVisitor - Rename the listener to not be called a "sink". If it were a "sink" it would be eating bytes and conform with any of the Nix sink stuff (maybe FileHandle should be a Sink itself! but that's a later CL's problem). This is a parser listener. - Move the RetrieveRegularNARSink thing into store-api.cc, which is its only usage, and fix it to actually do what it is stated to do: crash if its invariants are violated. It's, of course, used to erm, unpack single-file NAR files, generated via a horrible contraption of sources and sinks that looks like a plumbing blueprint. Refactoring that is a future task. - Add a description of the invariants of NARParseVisitor in preparation of refactoring it. Change-Id: Ifca1d74d2947204a1f66349772e54dad0743e944 --- src/libstore/nar-accessor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libstore/nar-accessor.cc') diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc index f0dfcb19b..fa7d5e3cb 100644 --- a/src/libstore/nar-accessor.cc +++ b/src/libstore/nar-accessor.cc @@ -2,6 +2,7 @@ #include "archive.hh" #include +#include #include #include @@ -33,7 +34,7 @@ struct NarAccessor : public FSAccessor NarMember root; - struct NarIndexer : ParseSink, Source + struct NarIndexer : NARParseVisitor, Source { NarAccessor & acc; Source & source; -- cgit v1.2.3