diff --git a/env/reader.hpp b/env/reader.hpp index 3a69c4d..175e846 100644 --- a/env/reader.hpp +++ b/env/reader.hpp @@ -25,6 +25,13 @@ public: s.resize(size); Read(&s[0], size); } + + void Read(bool & b) + { + int8_t i; + Read(i); + b = (i != 0 ? true : false); + } }; diff --git a/env/writer.hpp b/env/writer.hpp index 58dc25e..41c7bf9 100644 --- a/env/writer.hpp +++ b/env/writer.hpp @@ -23,6 +23,11 @@ public: Write(static_cast(count)); Write(s.c_str(), count); } + + void Write(bool b) + { + Write(static_cast(b ? 1 : 0)); + } };