src/BooleanDataTypeWriter.h
branchv_0
changeset 10 40ab091e5dfa
parent 9 0a40752e401d
child 11 27bc67e7c80f
--- a/src/BooleanDataTypeWriter.h	Sat Jul 21 17:30:25 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-#pragma once
-
-#include <string>
-#include <iostream>
-
-#include "DataTypeWriter.h"
-#include "../include/RelpipeWriterException.h"
-#include "format.h"
-
-namespace relpipe {
-namespace writer {
-
-class BooleanDataTypeWriter : public DataTypeWriter<boolean_t> {
-private:
-	const string_t TRUE = L"true";
-	const string_t FALSE = L"false";
-public:
-
-	BooleanDataTypeWriter() : DataTypeWriter<boolean_t>(DATA_TYPE_ID_BOOLEAN, DATA_TYPE_CODE_BOOLEAN) {
-	}
-
-	void writeValue(std::ostream &output, const boolean_t &value) override {
-		output.put(value ? 1 : 0);
-	}
-
-	bool toValue(const string_t &stringValue) override {
-		if (stringValue == TRUE) return true;
-		else if (stringValue == FALSE) return false;
-		else throw RelpipeWriterException(L"Unable to convert the string to boolean");
-	}
-
-};
-
-}
-}
\ No newline at end of file