diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-17T15·31+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-17T15·31+0100 |
commit | 0f2cf531f705d370321843e5ba9135b2ebdb5d19 (patch) | |
tree | 256feb13963a849ed96e89228fa05454c2a22363 /third_party/nix/src/libutil/archive.hh | |
parent | 65a1aae98ce5a237c9643e639e550c8b0c0be7f1 (diff) |
style(3p/nix): Reformat project in Google C++ style r/740
Reformatted with: fd . -e hh -e cc | xargs clang-format -i
Diffstat (limited to 'third_party/nix/src/libutil/archive.hh')
-rw-r--r-- | third_party/nix/src/libutil/archive.hh | 43 |
1 files changed, 18 insertions, 25 deletions
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 |