util: add printHex() overload that takes a uint64_t

And AsHex helper class.

Change-Id: If6fb6edea258ab281b5ea9cc30deffd2d8994dc5
Refs: #3006
diff --git a/src/mgmt/nfd/face-status.cpp b/src/mgmt/nfd/face-status.cpp
index ea0d546..df0521f 100644
--- a/src/mgmt/nfd/face-status.cpp
+++ b/src/mgmt/nfd/face-status.cpp
@@ -24,8 +24,7 @@
 #include "encoding/encoding-buffer.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "util/concepts.hpp"
-
-#include <iomanip>
+#include "util/string-helper.hpp"
 
 namespace ndn {
 namespace nfd {
@@ -366,15 +365,9 @@
 
   os << "     FaceScope: " << status.getFaceScope() << ",\n"
      << "     FacePersistency: " << status.getFacePersistency() << ",\n"
-     << "     LinkType: " << status.getLinkType() << ",\n";
-
-  auto osFlags = os.flags();
-  // std::showbase doesn't work with number 0
-  os << "     Flags: 0x" << std::noshowbase << std::noshowpos << std::nouppercase
-     << std::hex << status.getFlags() << ",\n";
-  os.flags(osFlags);
-
-  os << "     Counters: {Interests: {in: " << status.getNInInterests() << ", "
+     << "     LinkType: " << status.getLinkType() << ",\n"
+     << "     Flags: " << AsHex{status.getFlags()} << ",\n"
+     << "     Counters: {Interests: {in: " << status.getNInInterests() << ", "
      << "out: " << status.getNOutInterests() << "},\n"
      << "                Data: {in: " << status.getNInDatas() << ", "
      << "out: " << status.getNOutDatas() << "},\n"