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-event-notification.cpp b/src/mgmt/nfd/face-event-notification.cpp
index 505026b..888fe61 100644
--- a/src/mgmt/nfd/face-event-notification.cpp
+++ b/src/mgmt/nfd/face-event-notification.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 {
@@ -197,13 +196,8 @@
<< " LocalUri: " << notification.getLocalUri() << ",\n"
<< " FaceScope: " << notification.getFaceScope() << ",\n"
<< " FacePersistency: " << notification.getFacePersistency() << ",\n"
- << " LinkType: " << notification.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 << notification.getFlags() << "\n";
- os.flags(osFlags);
+ << " LinkType: " << notification.getLinkType() << ",\n"
+ << " Flags: " << AsHex{notification.getFlags()} << "\n";
return os << " )";
}