util: add printHex() overload that takes a uint64_t

And AsHex helper class.

Change-Id: If6fb6edea258ab281b5ea9cc30deffd2d8994dc5
Refs: #3006
diff --git a/src/mgmt/nfd/rib-entry.cpp b/src/mgmt/nfd/rib-entry.cpp
index 17b53d6..c7ec47a 100644
--- a/src/mgmt/nfd/rib-entry.cpp
+++ b/src/mgmt/nfd/rib-entry.cpp
@@ -24,6 +24,7 @@
 #include "encoding/encoding-buffer.hpp"
 #include "encoding/tlv-nfd.hpp"
 #include "util/concepts.hpp"
+#include "util/string-helper.hpp"
 
 #include <boost/range/adaptor/reversed.hpp>
 
@@ -206,13 +207,8 @@
   os << "Route("
      << "FaceId: " << route.getFaceId() << ", "
      << "Origin: " << route.getOrigin() << ", "
-     << "Cost: " << route.getCost() << ", ";
-
-  auto osFlags = os.flags();
-  // std::showbase doesn't work with number 0
-  os << "Flags: 0x" << std::noshowbase << std::noshowpos << std::nouppercase
-     << std::hex << route.getFlags() << ", ";
-  os.flags(osFlags);
+     << "Cost: " << route.getCost() << ", "
+     << "Flags: " << AsHex{route.getFlags()} << ", ";
 
   if (route.hasExpirationPeriod()) {
     os << "ExpirationPeriod: " << route.getExpirationPeriod();