* Use a proper namespace.
* Optimise header file usage a bit. * Compile the parser as C++.
This commit is contained in:
		
							parent
							
								
									aab8812732
								
							
						
					
					
						commit
						75068e7d75
					
				
					 61 changed files with 650 additions and 268 deletions
				
			
		| 
						 | 
				
			
			@ -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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue