diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-02 19:04:27 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-07 09:09:43 +0200 |
commit | a6dfa3cb85b59a0979de7fe02c9d67939c4ac217 (patch) | |
tree | 7c3d1b39c4f4efc7bed5428f613d248cbaf67c2a /src | |
parent | f58a9b0e62879e28cc7cac59b489a52c924bbc36 (diff) |
PathInput: Add some methods
(cherry picked from commit 78ad5b3d91507427fa563f3474dc52da608ad224)
Diffstat (limited to 'src')
-rw-r--r-- | src/libfetchers/path.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libfetchers/path.cc b/src/libfetchers/path.cc index 9801d9b86..037404726 100644 --- a/src/libfetchers/path.cc +++ b/src/libfetchers/path.cc @@ -19,6 +19,22 @@ struct PathInput : Input std::optional<Hash> getRev() const override { return rev; } + bool operator ==(const Input & other) const override + { + auto other2 = dynamic_cast<const PathInput *>(&other); + return + other2 + && path == other2->path + && rev == other2->rev + && revCount == other2->revCount + && lastModified == other2->lastModified; + } + + bool isImmutable() const override + { + return (bool) narHash; + } + ParsedURL toURL() const override { auto query = attrsToQuery(toAttrsInternal()); |