added support for morm::Model to Log:

Log & operator<<(morm::Model & model);
but we need some kind of a macro to allow this
This commit is contained in:
Tomasz Sowa 2021-04-30 01:17:47 +02:00
parent f572250572
commit 96eedd9be9
2 changed files with 22 additions and 0 deletions

View File

@ -41,6 +41,8 @@
#include "date/date.h" #include "date/date.h"
#include "utf8/utf8.h" #include "utf8/utf8.h"
#include "morm.h"
namespace PT namespace PT
{ {
@ -311,6 +313,14 @@ Log & Log::operator<<(const PT::Date & date)
Log & Log::operator<<(morm::Model & model)
{
operator<<(model.to_string());
return *this;
}
Log & Log::operator<<(Manipulators m) Log & Log::operator<<(Manipulators m)
{ {
switch(m) switch(m)

View File

@ -45,6 +45,12 @@
namespace morm
{
class Model;
}
namespace PT namespace PT
{ {
@ -125,8 +131,14 @@ public:
virtual Log & operator<<(const PT::Space & space); virtual Log & operator<<(const PT::Space & space);
virtual Log & operator<<(const PT::Date & date); virtual Log & operator<<(const PT::Date & date);
virtual Log & operator<<(morm::Model & model);
virtual Log & operator<<(Manipulators m); virtual Log & operator<<(Manipulators m);
virtual Log & LogString(const std::string & value, size_t max_size); virtual Log & LogString(const std::string & value, size_t max_size);
virtual Log & LogString(const std::wstring & value, size_t max_size); virtual Log & LogString(const std::wstring & value, size_t max_size);