util: add printHex() overload that takes a uint64_t

And AsHex helper class.

Change-Id: If6fb6edea258ab281b5ea9cc30deffd2d8994dc5
Refs: #3006
diff --git a/src/mgmt/nfd/control-parameters.cpp b/src/mgmt/nfd/control-parameters.cpp
index 30f8fe9..4958749 100644
--- a/src/mgmt/nfd/control-parameters.cpp
+++ b/src/mgmt/nfd/control-parameters.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2013-2016 Regents of the University of California.
+ * Copyright (c) 2013-2017 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,6 +23,7 @@
 #include "encoding/tlv-nfd.hpp"
 #include "encoding/block-helpers.hpp"
 #include "util/concepts.hpp"
+#include "util/string-helper.hpp"
 
 namespace ndn {
 namespace nfd {
@@ -304,15 +305,11 @@
   }
 
   if (parameters.hasFlags()) {
-    std::ios_base::fmtflags osFlags = os.flags();
-    os << "Flags: " << std::showbase << std::hex << parameters.getFlags() << ", ";
-    os.flags(osFlags);
+    os << "Flags: " << AsHex{parameters.getFlags()} << ", ";
   }
 
   if (parameters.hasMask()) {
-    std::ios_base::fmtflags osFlags = os.flags();
-    os << "Mask: " << std::showbase << std::hex << parameters.getMask() << ", ";
-    os.flags(osFlags);
+    os << "Mask: " << AsHex{parameters.getMask()} << ", ";
   }
 
   if (parameters.hasStrategy()) {