Restructured rhubarb-exporters

This commit is contained in:
Daniel Wolf
2016-11-16 11:35:27 +01:00
parent 3e34425c11
commit 289b7ba56e
14 changed files with 200 additions and 158 deletions

28
src/ExportFormat.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include "ExportFormat.h"
using std::string;
ExportFormatConverter& ExportFormatConverter::get() {
static ExportFormatConverter converter;
return converter;
}
string ExportFormatConverter::getTypeName() {
return "ExportFormat";
}
EnumConverter<ExportFormat>::member_data ExportFormatConverter::getMemberData() {
return member_data{
{ ExportFormat::TSV, "TSV" },
{ ExportFormat::XML, "XML" },
{ ExportFormat::JSON, "JSON" }
};
}
std::ostream& operator<<(std::ostream& stream, ExportFormat value) {
return ExportFormatConverter::get().write(stream, value);
}
std::istream& operator>>(std::istream& stream, ExportFormat& value) {
return ExportFormatConverter::get().read(stream, value);
}