Skip to content

Commit

Permalink
More support for date
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Oct 16, 2023
1 parent 1ec0db5 commit 1c9f82a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/console_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 1c9f82a

Please sign in to comment.