about summary refs log tree commit diff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
commit75068e7d753cf6cbe45a4bf294000dca9bd41d8b (patch)
treec6274cc10caab08349b5585206034f41ca4a575f /src/libutil/hash.cc
parentaab88127321344d5818d823bff515d127108d058 (diff)
* Use a proper namespace.
* Optimise header file usage a bit.
* Compile the parser as C++.

Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index b69c148328..16597fd47c 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 <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
 
+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;
 }
+
+ 
+}