2012-07-18 18:59:03 +00:00
|
|
|
#pragma once
|
2004-02-06 14:49:41 +00:00
|
|
|
|
2014-10-03 19:29:20 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2006-09-04 21:06:23 +00:00
|
|
|
#include "types.hh"
|
2004-02-06 14:49:41 +00:00
|
|
|
|
2006-09-04 21:06:23 +00:00
|
|
|
namespace nix {
|
2004-02-06 14:49:41 +00:00
|
|
|
|
2020-09-21 16:22:45 +00:00
|
|
|
struct Regex;
|
|
|
|
|
2004-02-06 14:49:41 +00:00
|
|
|
struct DrvName
|
|
|
|
{
|
|
|
|
string fullName;
|
|
|
|
string name;
|
|
|
|
string version;
|
|
|
|
unsigned int hits;
|
|
|
|
|
2004-02-09 11:59:39 +00:00
|
|
|
DrvName();
|
2019-12-05 18:11:09 +00:00
|
|
|
DrvName(std::string_view s);
|
2020-09-21 16:22:45 +00:00
|
|
|
~DrvName();
|
|
|
|
|
2021-11-18 13:32:52 +00:00
|
|
|
bool matches(const DrvName & n);
|
2014-10-03 19:29:20 +00:00
|
|
|
|
|
|
|
private:
|
2020-09-21 16:22:45 +00:00
|
|
|
std::unique_ptr<Regex> regex;
|
2004-02-06 14:49:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef list<DrvName> DrvNames;
|
|
|
|
|
2022-01-21 13:44:00 +00: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 14:49:41 +00:00
|
|
|
DrvNames drvNamesFromArgs(const Strings & opArgs);
|
|
|
|
|
2006-09-04 21:06:23 +00:00
|
|
|
}
|