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-hash/nix-hash.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/nix-hash') diff --git a/src/nix-hash/nix-hash.cc b/src/nix-hash/nix-hash.cc index dd2ed8d4f4fa..1282af070e62 100644 --- a/src/nix-hash/nix-hash.cc +++ b/src/nix-hash/nix-hash.cc @@ -5,9 +5,12 @@ #include "help.txt.hh" +using namespace nix; + + void printHelp() { - cout << string((char *) helpText, sizeof helpText); + std::cout << string((char *) helpText, sizeof helpText); } @@ -43,7 +46,7 @@ void run(Strings args) for (Strings::iterator i = ss.begin(); i != ss.end(); ++i) { Hash h = flat ? hashFile(ht, *i) : hashPath(ht, *i); if (truncate && h.hashSize > 20) h = compressHash(h, 20); - cout << format("%1%\n") % + std::cout << format("%1%\n") % (base32 ? printHash32(h) : printHash(h)); } } @@ -51,7 +54,7 @@ void run(Strings args) else { for (Strings::iterator i = ss.begin(); i != ss.end(); ++i) { Hash h = op == opTo16 ? parseHash32(ht, *i) : parseHash(ht, *i); - cout << format("%1%\n") % + std::cout << format("%1%\n") % (op == opTo16 ? printHash(h) : printHash32(h)); } } -- cgit 1.4.1