From 75068e7d753cf6cbe45a4bf294000dca9bd41d8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Sep 2006 21:06:23 +0000 Subject: * Use a proper namespace. * Optimise header file usage a bit. * Compile the parser as C++. --- src/nix-instantiate/main.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/nix-instantiate/main.cc') diff --git a/src/nix-instantiate/main.cc b/src/nix-instantiate/main.cc index eb5c1ce8552d..91720b1d55ff 100644 --- a/src/nix-instantiate/main.cc +++ b/src/nix-instantiate/main.cc @@ -10,12 +10,17 @@ #include "get-drvs.hh" #include "attr-path.hh" #include "expr-to-xml.hh" +#include "util.hh" +#include "store.hh" #include "help.txt.hh" +using namespace nix; + + void printHelp() { - cout << string((char *) helpText, sizeof helpText); + std::cout << string((char *) helpText, sizeof helpText); } @@ -23,7 +28,7 @@ static Expr parseStdin(EvalState & state) { startNest(nest, lvlTalkative, format("parsing standard input")); string s, s2; - while (getline(cin, s2)) s += s2 + "\n"; + while (getline(std::cin, s2)) s += s2 + "\n"; return parseExprFromString(state, s, absPath(".")); } @@ -38,9 +43,9 @@ static void printResult(EvalState & state, Expr e, { if (evalOnly) if (xmlOutput) - printTermAsXML(e, cout); + printTermAsXML(e, std::cout); else - cout << format("%1%\n") % e; + std::cout << format("%1%\n") % e; else { DrvInfos drvs; @@ -53,7 +58,7 @@ static void printResult(EvalState & state, Expr e, drvPath = addPermRoot(drvPath, makeRootName(gcRoot, rootNr), indirectRoot); - cout << format("%1%\n") % drvPath; + std::cout << format("%1%\n") % drvPath; } } } -- cgit 1.4.1