diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-04T21·06+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2006-09-04T21·06+0000 |
commit | 75068e7d753cf6cbe45a4bf294000dca9bd41d8b (patch) | |
tree | c6274cc10caab08349b5585206034f41ca4a575f /src/nix-instantiate | |
parent | aab88127321344d5818d823bff515d127108d058 (diff) |
* Use a proper namespace.
* Optimise header file usage a bit. * Compile the parser as C++.
Diffstat (limited to 'src/nix-instantiate')
-rw-r--r-- | src/nix-instantiate/main.cc | 15 |
1 files changed, 10 insertions, 5 deletions
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; } } } |