Merge /users/m4burns/pos
authorJacob Parker <j3parker@uwaterloo.ca>
Thu, 10 Nov 2011 22:22:09 +0000 (17:22 -0500)
committerJacob Parker <j3parker@uwaterloo.ca>
Thu, 10 Nov 2011 22:22:09 +0000 (17:22 -0500)
database/db.cpp
database/log.cpp

index 73f994e..c22063c 100644 (file)
@@ -289,5 +289,6 @@ uint64_t PosDb::doStockChange(UPC upc, int32_t delta) {
 }
 
 std::vector<std::string> PosDb::toString() {
+
   return log.toString();
 }
index 5fd1ac7..40325e7 100644 (file)
@@ -100,17 +100,20 @@ std::vector<std::string> Log::toString()
         out += ns.get_name(it->Transaction.uid) + "\t"
              + ThingToString<int32_t>(it->Transaction.delta);
         break;
-      case ET_HASH:
-        out += "hash goes here\t"
+      case ET_HASH: {
+        SHA1Hash h;
+        h.set((unsigned char*)it->HashChange.hash);
+        out += h.toHex() + "\t"
              + ns.get_name(it->HashChange.uid) + "\t"
              + ThingToString<bool>(it->HashChange.add);
         break;
+      }
       case ET_SALE:
-        out += "upc goes here\t"
+        out += ThingToString<uint64_t>(it->StockChange.upc.l) + ThingToString<uint64_t>(it->StockChange.upc.h) + "\t"
              + ThingToString<int32_t>(it->StockChange.delta);
         break;
       case ET_PRICE:
-        out += "upc goes here\t"
+        out += ThingToString<uint64_t>(it->PriceChange.upc.l) + ThingToString<uint64_t>(it->PriceChange.upc.h) + "\t"
              + ThingToString<int32_t>(it->PriceChange.price);
         break;
       case ET_REVERT: