diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-18 23:02:25 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-03-18 23:02:25 +0100 |
commit | 17de795175d0573d8ac6c2517d0eb35e8a4f8f69 (patch) | |
tree | b8702d89a2e4e63a4f979ca4d73ccdf0cbb61bb3 /apps/SoilMoistureIo.h | |
parent | 225ed55918377ba2b53bb535cb636bfae8fc1ab4 (diff) | |
download | ble-toys-17de795175d0573d8ac6c2517d0eb35e8a4f8f69.tar.gz ble-toys-17de795175d0573d8ac6c2517d0eb35e8a4f8f69.tar.bz2 ble-toys-17de795175d0573d8ac6c2517d0eb35e8a4f8f69.tar.xz ble-toys-17de795175d0573d8ac6c2517d0eb35e8a4f8f69.zip |
o Replacing custom Format with common sample_format_type.
Diffstat (limited to 'apps/SoilMoistureIo.h')
-rw-r--r-- | apps/SoilMoistureIo.h | 15 |
1 files changed, 15 insertions, 0 deletions
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<ostream> stream; }; +class KeyValueSampleOutputStream : public SampleOutputStream { +public: + KeyValueSampleOutputStream(shared_ptr<ostream> stream, KeyDictionary &dict); + + void write(SampleRecord sample) override; + +private: + KeyDictionary &dict; + shared_ptr<ostream> stream; +}; + class SqlSampleOutputStream : public SampleOutputStream { public: SqlSampleOutputStream(shared_ptr<ostream> stream, KeyDictionary &dict, string table_name); |