diff options
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/archive.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libutil/archive.hh b/src/libutil/archive.hh index d58b91df0461..c067cd2ad243 100644 --- a/src/libutil/archive.hh +++ b/src/libutil/archive.hh @@ -70,6 +70,19 @@ struct ParseSink virtual void createSymlink(const Path & path, const string & target) { }; }; +struct TeeSink : ParseSink +{ + TeeSource source; + + TeeSink(Source & source) : source(source) { } + + void preallocateContents(unsigned long long size) override + { + source.data->reserve(source.data->size() + size + 1024); + }; + +}; + void parseDump(ParseSink & sink, Source & source); void restorePath(const Path & path, Source & source); |