diff --git a/include/writer.hpp b/include/writer.hpp index 4895eab..cf18098 100644 --- a/include/writer.hpp +++ b/include/writer.hpp @@ -89,8 +89,9 @@ struct writer { virtual writer& operator<<(double value) = 0; virtual writer& operator<<(const budget::money& m) = 0; + virtual writer& operator<<(const budget::year& y) = 0; virtual writer& operator<<(const budget::month& m) = 0; - virtual writer& operator<<(const budget::year& m) = 0; + virtual writer& operator<<(const budget::day& d) = 0; virtual writer& operator<<(const end_of_line_t& m) = 0; virtual writer& operator<<(const p_begin_t& m) = 0; @@ -143,8 +144,9 @@ struct console_writer : writer { writer& operator<<(double value) override; writer& operator<<(const budget::money& m) override; + writer& operator<<(const budget::year& y) override; writer& operator<<(const budget::month& m) override; - writer& operator<<(const budget::year& m) override; + writer& operator<<(const budget::day& d) override; writer& operator<<(const end_of_line_t& m) override; writer& operator<<(const p_begin_t& m) override; diff --git a/src/console_writer.cpp b/src/console_writer.cpp index 8913d16..812ad65 100644 --- a/src/console_writer.cpp +++ b/src/console_writer.cpp @@ -121,6 +121,12 @@ budget::writer& budget::console_writer::operator<<(const budget::money& m) { return *this; } +budget::writer& budget::console_writer::operator<<(const budget::day& d) { + os << d.value; + + return *this; +} + budget::writer& budget::console_writer::operator<<(const budget::month& m) { os << m.as_short_string();