1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 11:11:03 -04:00
nix/src/libstore/names.hh

37 lines
644 B
C++
Raw Normal View History

#pragma once
///@file
2004-02-06 09:49:41 -05:00
#include <memory>
#include "types.hh"
2004-02-06 09:49:41 -05:00
namespace nix {
2004-02-06 09:49:41 -05:00
struct Regex;
2004-02-06 09:49:41 -05:00
struct DrvName
{
2022-02-21 10:37:25 -05:00
std::string fullName;
std::string name;
std::string version;
2004-02-06 09:49:41 -05:00
unsigned int hits;
DrvName();
DrvName(std::string_view s);
~DrvName();
bool matches(const DrvName & n);
private:
std::unique_ptr<Regex> regex;
2004-02-06 09:49:41 -05:00
};
2022-02-21 10:25:12 -05:00
typedef std::list<DrvName> DrvNames;
2004-02-06 09:49:41 -05:00
std::string_view nextComponent(std::string_view::const_iterator & p,
const std::string_view::const_iterator end);
int compareVersions(const std::string_view v1, const std::string_view v2);
2004-02-06 09:49:41 -05:00
DrvNames drvNamesFromArgs(const Strings & opArgs);
}