string is the default type in recfile, so there is no need for %type metadata for string attributes
and recfix will also stop complaining about:
stdin:2: error: invalid type specification
--- a/src/RecfileHandler.h Sat Mar 30 16:14:41 2019 +0100
+++ b/src/RecfileHandler.h Sun Apr 07 12:49:38 2019 +0200
@@ -58,15 +58,15 @@
switch (type) {
case TypeId::BOOLEAN: return "bool";
case TypeId::INTEGER: return "int";
- case TypeId::STRING: return ""; // TODO: string type?
+ case TypeId::STRING: return "";
default: throw RelpipeReaderException(L"Unsupported type – unable to convert to a Recfile type");
}
}
void writeAttributeMetadata(const handlers::AttributeMetadata& attribute) {
// FIXME: escaping/filtering
- // FIXME: translate to recfile types
- output << "%type: " << convertor.to_bytes(attribute.getAttributeName()) << " " << toRecfileType(attribute.getTypeId()) << std::endl;
+ std::string recfileType = toRecfileType(attribute.getTypeId());
+ if (recfileType.size()) output << "%type: " << convertor.to_bytes(attribute.getAttributeName()) << " " << recfileType << std::endl;
}
void writeSeparator() {