tools: rename nfd::tools::nfdc::OutputFormat to ReportFormat
refs #3749
Change-Id: I4984d056c26f9ecbda25103ad60dc50bb60a4dec
diff --git a/tools/nfdc/status-report.cpp b/tools/nfdc/status-report.cpp
index c687147..ff3e8a6 100644
--- a/tools/nfdc/status-report.cpp
+++ b/tools/nfdc/status-report.cpp
@@ -30,6 +30,30 @@
namespace tools {
namespace nfdc {
+ReportFormat
+parseReportFormat(const std::string& s)
+{
+ if (s == "xml") {
+ return ReportFormat::XML;
+ }
+ if (s == "text") {
+ return ReportFormat::TEXT;
+ }
+ BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized ReportFormat"));
+}
+
+std::ostream&
+operator<<(std::ostream& os, ReportFormat fmt)
+{
+ switch (fmt) {
+ case ReportFormat::XML:
+ return os << "xml";
+ case ReportFormat::TEXT:
+ return os << "text";
+ }
+ return os << static_cast<int>(fmt);
+}
+
uint32_t
StatusReport::collect(Face& face, KeyChain& keyChain, Validator& validator, const CommandOptions& options)
{