Add comparison functions for NarInfo

We will need these for tests.
This commit is contained in:
John Ericson 2023-10-26 19:39:21 -04:00
parent 1a14ce8381
commit 0b0d1b5214
2 changed files with 11 additions and 0 deletions

View file

@ -4,6 +4,15 @@
namespace nix {
GENERATE_CMP_EXT(
,
NarInfo,
me->url,
me->compression,
me->fileHash,
me->fileSize,
static_cast<const ValidPathInfo &>(*me));
NarInfo::NarInfo(const Store & store, const std::string & s, const std::string & whence)
: ValidPathInfo(StorePath(StorePath::dummy), Hash(Hash::dummy)) // FIXME: hack
{

View file

@ -24,6 +24,8 @@ struct NarInfo : ValidPathInfo
NarInfo(const ValidPathInfo & info) : ValidPathInfo(info) { }
NarInfo(const Store & store, const std::string & s, const std::string & whence);
DECLARE_CMP(NarInfo);
std::string to_string(const Store & store) const;
};