1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 16:02:43 +01:00

Move progress-bar.cc to libmain

Needed so that we can include it as a logger in loggers.cc without
adding a dependency on nix

This also requires moving names.hh to libutil to prevent a circular
dependency between libmain and libexpr
This commit is contained in:
regnat 2020-06-08 17:16:52 +02:00
parent c27f92698b
commit 801112de1a
6 changed files with 2 additions and 2 deletions

32
src/libutil/names.hh Normal file
View file

@ -0,0 +1,32 @@
#pragma once
#include <memory>
#include "types.hh"
#include <regex>
namespace nix {
struct DrvName
{
string fullName;
string name;
string version;
unsigned int hits;
DrvName();
DrvName(std::string_view s);
bool matches(DrvName & n);
private:
std::unique_ptr<std::regex> regex;
};
typedef list<DrvName> DrvNames;
string nextComponent(string::const_iterator & p,
const string::const_iterator end);
int compareVersions(const string & v1, const string & v2);
DrvNames drvNamesFromArgs(const Strings & opArgs);
}