aboutsummaryrefslogtreecommitdiff
path: root/src/libfetchers/tree-info.hh
blob: 9d187209742797f649935c10d2046b825b0f7bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "path.hh"
#include "hash.hh"

#include <nlohmann/json_fwd.hpp>

namespace nix { class Store; }

namespace nix::fetchers {

struct TreeInfo
{
    std::optional<Hash> narHash;
    std::optional<uint64_t> revCount;
    std::optional<time_t> lastModified;

    bool operator ==(const TreeInfo & other) const
    {
        return
            narHash == other.narHash
            && revCount == other.revCount
            && lastModified == other.lastModified;
    }

    StorePath computeStorePath(Store & store) const;
};

}