1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 03:23:16 +02:00

* Use a proper namespace.

* Optimise header file usage a bit.
* Compile the parser as C++.
This commit is contained in:
Eelco Dolstra 2006-09-04 21:06:23 +00:00
parent aab8812732
commit 75068e7d75
61 changed files with 650 additions and 268 deletions

View file

@ -1,9 +1,13 @@
#include "globals.hh"
#include "util.hh"
#include <map>
#include <algorithm>
namespace nix {
string nixStore = "/UNINIT";
string nixDataDir = "/UNINIT";
string nixLogDir = "/UNINIT";
@ -23,7 +27,7 @@ string thisSystem = "unset";
static bool settingsRead = false;
static map<string, Strings> settings;
static std::map<string, Strings> settings;
string & at(Strings & ss, unsigned int n)
@ -72,7 +76,7 @@ static void readSettings()
Strings querySetting(const string & name, const Strings & def)
{
if (!settingsRead) readSettings();
map<string, Strings>::iterator i = settings.find(name);
std::map<string, Strings>::iterator i = settings.find(name);
return i == settings.end() ? def : i->second;
}
@ -98,3 +102,6 @@ bool queryBoolSetting(const string & name, bool def)
else throw Error(format("configuration option `%1%' should be either `true' or `false', not `%2%'")
% name % v);
}
}