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/libutil/hash.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/libutil/hash.cc') diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index b69c14832877..16597fd47cbf 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -15,12 +15,16 @@ extern "C" { #include "hash.hh" #include "archive.hh" +#include "util.hh" #include #include #include +namespace nix { + + Hash::Hash() { type = htUnknown; @@ -89,9 +93,9 @@ Hash parseHash(HashType ht, const string & s) string s2(s, i * 2, 2); if (!isxdigit(s2[0]) || !isxdigit(s2[1])) throw Error(format("invalid hash `%1%'") % s); - istringstream str(s2); + std::istringstream str(s2); int n; - str >> hex >> n; + str >> std::hex >> n; hash.hash[i] = n; } return hash; @@ -313,3 +317,6 @@ HashType parseHashType(const string & s) else if (s == "sha256") return htSHA256; else return htUnknown; } + + +} -- cgit 1.4.1