2012-07-18 14:59:03 -04:00
|
|
|
#pragma once
|
2006-09-04 17:06:23 -04:00
|
|
|
|
2016-02-23 07:53:31 -05:00
|
|
|
#include "ref.hh"
|
|
|
|
|
2006-09-04 17:06:23 -04:00
|
|
|
#include <list>
|
|
|
|
#include <set>
|
2020-06-29 17:21:27 -04:00
|
|
|
#include <string>
|
2017-04-13 09:55:38 -04:00
|
|
|
#include <map>
|
2020-05-14 14:28:18 -04:00
|
|
|
#include <vector>
|
2014-10-20 12:15:50 -04:00
|
|
|
|
2006-09-04 17:06:23 -04:00
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
using std::list;
|
|
|
|
using std::set;
|
|
|
|
using std::vector;
|
2020-05-11 17:52:15 -04:00
|
|
|
using std::string;
|
2017-05-11 11:06:07 -04:00
|
|
|
|
2020-05-13 17:56:39 -04:00
|
|
|
typedef list<string> Strings;
|
|
|
|
typedef set<string> StringSet;
|
|
|
|
typedef std::map<string, string> StringMap;
|
2006-09-04 17:06:23 -04:00
|
|
|
|
|
|
|
/* Paths are just strings. */
|
2020-04-24 16:57:51 -04:00
|
|
|
|
2020-05-13 17:56:39 -04:00
|
|
|
typedef string Path;
|
2006-09-04 17:06:23 -04:00
|
|
|
typedef list<Path> Paths;
|
|
|
|
typedef set<Path> PathSet;
|
|
|
|
|
2020-06-17 15:08:59 -04:00
|
|
|
typedef vector<std::pair<string, string>> Headers;
|
|
|
|
|
2020-03-30 10:04:18 -04:00
|
|
|
/* Helper class to run code at startup. */
|
|
|
|
template<typename T>
|
|
|
|
struct OnStartup
|
|
|
|
{
|
|
|
|
OnStartup(T && t) { t(); }
|
|
|
|
};
|
|
|
|
|
2020-10-26 11:58:58 -04:00
|
|
|
/* Wrap bools to prevent string literals (i.e. 'char *') from being
|
|
|
|
cast to a bool in Attr. */
|
|
|
|
template<typename T>
|
|
|
|
struct Explicit {
|
|
|
|
T t;
|
|
|
|
|
|
|
|
bool operator ==(const Explicit<T> & other) const
|
|
|
|
{
|
|
|
|
return t == other.t;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-09-04 17:06:23 -04:00
|
|
|
}
|