From 17de795175d0573d8ac6c2517d0eb35e8a4f8f69 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 18 Mar 2015 23:02:25 +0100 Subject: o Replacing custom Format with common sample_format_type. --- apps/SoilMoistureIo.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'apps/SoilMoistureIo.h') diff --git a/apps/SoilMoistureIo.h b/apps/SoilMoistureIo.h index 5324114..3e78f46 100644 --- a/apps/SoilMoistureIo.h +++ b/apps/SoilMoistureIo.h @@ -31,6 +31,10 @@ enum class sample_format_type { string to_string(const sample_format_type &arg); +std::ostream& operator<<(std::ostream& os, sample_format_type const& type); + +std::istream& operator>>(std::istream& is, sample_format_type& type); + class SampleStreamParser; class SampleOutputStream; @@ -270,6 +274,17 @@ private: shared_ptr stream; }; +class KeyValueSampleOutputStream : public SampleOutputStream { +public: + KeyValueSampleOutputStream(shared_ptr stream, KeyDictionary &dict); + + void write(SampleRecord sample) override; + +private: + KeyDictionary &dict; + shared_ptr stream; +}; + class SqlSampleOutputStream : public SampleOutputStream { public: SqlSampleOutputStream(shared_ptr stream, KeyDictionary &dict, string table_name); -- cgit v1.2.3