From 0f2cf531f705d370321843e5ba9135b2ebdb5d19 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 17 May 2020 16:31:57 +0100 Subject: style(3p/nix): Reformat project in Google C++ style Reformatted with: fd . -e hh -e cc | xargs clang-format -i --- third_party/nix/src/libutil/archive.hh | 43 ++++++++++++++-------------------- 1 file changed, 18 insertions(+), 25 deletions(-) (limited to 'third_party/nix/src/libutil/archive.hh') diff --git a/third_party/nix/src/libutil/archive.hh b/third_party/nix/src/libutil/archive.hh index 25be426c1a4d..9a656edae4a3 100644 --- a/third_party/nix/src/libutil/archive.hh +++ b/third_party/nix/src/libutil/archive.hh @@ -1,12 +1,10 @@ #pragma once -#include "types.hh" #include "serialise.hh" - +#include "types.hh" namespace nix { - /* dumpPath creates a Nix archive of the specified path. The format is as follows: @@ -44,41 +42,36 @@ namespace nix { `+' denotes string concatenation. */ +void dumpPath(const Path& path, Sink& sink, + PathFilter& filter = defaultPathFilter); -void dumpPath(const Path & path, Sink & sink, - PathFilter & filter = defaultPathFilter); - -void dumpString(const std::string & s, Sink & sink); +void dumpString(const std::string& s, Sink& sink); /* FIXME: fix this API, it sucks. */ -struct ParseSink -{ - virtual void createDirectory(const Path & path) { }; +struct ParseSink { + virtual void createDirectory(const Path& path){}; - virtual void createRegularFile(const Path & path) { }; - virtual void isExecutable() { }; - virtual void preallocateContents(unsigned long long size) { }; - virtual void receiveContents(unsigned char * data, unsigned int len) { }; + virtual void createRegularFile(const Path& path){}; + virtual void isExecutable(){}; + virtual void preallocateContents(unsigned long long size){}; + virtual void receiveContents(unsigned char* data, unsigned int len){}; - virtual void createSymlink(const Path & path, const string & target) { }; + virtual void createSymlink(const Path& path, const string& target){}; }; -struct TeeSink : ParseSink -{ - TeeSource source; +struct TeeSink : ParseSink { + TeeSource source; - TeeSink(Source & source) : source(source) { } + TeeSink(Source& source) : source(source) {} }; -void parseDump(ParseSink & sink, Source & source); +void parseDump(ParseSink& sink, Source& source); -void restorePath(const Path & path, Source & source); +void restorePath(const Path& path, Source& source); /* Read a NAR from 'source' and write it to 'sink'. */ -void copyNAR(Source & source, Sink & sink); - +void copyNAR(Source& source, Sink& sink); extern const std::string narVersionMagic1; - -} +} // namespace nix -- cgit 1.4.1