diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-06 21:07:34 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-06 21:07:34 +0100 |
commit | a83e6f5960a549d54991495336bd12d549127d91 (patch) | |
tree | d21f63b718d65074215fff6edbbcdbd5f26caf4a /apps/SoilMoistureIo.h | |
parent | e03bf5d416776cb5ea27c7354657920939c04e71 (diff) | |
download | ble-toys-a83e6f5960a549d54991495336bd12d549127d91.tar.gz ble-toys-a83e6f5960a549d54991495336bd12d549127d91.tar.bz2 ble-toys-a83e6f5960a549d54991495336bd12d549127d91.tar.xz ble-toys-a83e6f5960a549d54991495336bd12d549127d91.zip |
o Starting on a tool to convert between sample formats.
Diffstat (limited to 'apps/SoilMoistureIo.h')
-rw-r--r-- | apps/SoilMoistureIo.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/apps/SoilMoistureIo.h b/apps/SoilMoistureIo.h new file mode 100644 index 0000000..739758a --- /dev/null +++ b/apps/SoilMoistureIo.h @@ -0,0 +1,56 @@ +#ifndef SOIL_MOISTURE_IO_H +#define SOIL_MOISTURE_IO_H + +#include <ostream> +#include <vector> +#include <map> + +namespace trygvis { +namespace soil_moisture { + +using namespace std; + +class SampleOutputStream { +public: + typedef map<string, string> it; + + virtual void write(it values) = 0; +}; + +class CsvSampleOutputStream : public SampleOutputStream { +public: + CsvSampleOutputStream(ostream& stream, vector<string> fields); + + void write(it values); + +private: + ostream& stream; + vector<string> fields; +}; + +class JsonSampleOutputStream : public SampleOutputStream { +public: + JsonSampleOutputStream(ostream& stream, vector<string> fields); + + void write(it values); + +private: + ostream& stream; + vector<string> fields; +}; + +class SqlSampleOutputStream : public SampleOutputStream { +public: + SqlSampleOutputStream(ostream& stream, vector<string> fields); + + void write(it values); + +private: + ostream& stream; + vector<string> fields; +}; + +} +} + +#endif |