add some operators to the Log class

add:
virtual Log & operator<<(long double);
virtual Log & operator<<(float);
virtual Log & operator<<(long long unsigned int);
virtual Log & operator<<(unsigned int);
virtual Log & operator<<(short unsigned int);
virtual Log & operator<<(long long int);
virtual Log & operator<<(short int);
virtual Log & operator<<(bool);
virtual Log & operator<<(unsigned char);
virtual Log & operator<<(const pt::Stream &);
This commit is contained in:
Tomasz Sowa 2024-02-13 22:29:22 +01:00
parent 544ef298aa
commit b753464608
Signed by: tomasz.sowa
GPG Key ID: 662CC1438638588B
2 changed files with 91 additions and 14 deletions

View File

@ -4,8 +4,8 @@
* Author: Tomasz Sowa <t.sowa@ttmath.org> * Author: Tomasz Sowa <t.sowa@ttmath.org>
*/ */
/* /*
* Copyright (c) 2008-2022, Tomasz Sowa * Copyright (c) 2008-2024, Tomasz Sowa
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -118,7 +118,6 @@ Log & Log::operator<<(const std::string * s)
Log & Log::operator<<(const wchar_t * s) Log & Log::operator<<(const wchar_t * s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -126,7 +125,6 @@ Log & Log::operator<<(const wchar_t * s)
} }
Log & Log::operator<<(const std::wstring & s) Log & Log::operator<<(const std::wstring & s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -134,7 +132,6 @@ Log & Log::operator<<(const std::wstring & s)
} }
Log & Log::operator<<(const std::wstring * s) Log & Log::operator<<(const std::wstring * s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -143,6 +140,20 @@ Log & Log::operator<<(const std::wstring * s)
Log & Log::operator<<(bool s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(short s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(int s) Log & Log::operator<<(int s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -150,7 +161,6 @@ Log & Log::operator<<(int s)
} }
Log & Log::operator<<(long s) Log & Log::operator<<(long s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -158,6 +168,12 @@ Log & Log::operator<<(long s)
} }
Log & Log::operator<<(long long s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(char s) Log & Log::operator<<(char s)
@ -167,6 +183,13 @@ Log & Log::operator<<(char s)
} }
Log & Log::operator<<(unsigned char s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(wchar_t s) Log & Log::operator<<(wchar_t s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
@ -174,13 +197,41 @@ Log & Log::operator<<(wchar_t s)
} }
Log & Log::operator<<(size_t s) Log & Log::operator<<(unsigned short s)
{ {
pt::Log::operator<<(s); pt::Log::operator<<(s);
return *this; return *this;
} }
Log & Log::operator<<(unsigned int s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(unsigned long s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(unsigned long long s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(float s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(double s) Log & Log::operator<<(double s)
{ {
@ -189,6 +240,19 @@ Log & Log::operator<<(double s)
} }
Log & Log::operator<<(long double s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(const pt::Stream & s)
{
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(const pt::Space & s) Log & Log::operator<<(const pt::Space & s)
{ {

View File

@ -4,8 +4,8 @@
* Author: Tomasz Sowa <t.sowa@ttmath.org> * Author: Tomasz Sowa <t.sowa@ttmath.org>
*/ */
/* /*
* Copyright (c) 2008-2022, Tomasz Sowa * Copyright (c) 2008-2024, Tomasz Sowa
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -71,18 +71,31 @@ public:
virtual Log & operator<<(const wchar_t * s); virtual Log & operator<<(const wchar_t * s);
virtual Log & operator<<(const std::wstring * s); virtual Log & operator<<(const std::wstring * s);
virtual Log & operator<<(const std::wstring & s); virtual Log & operator<<(const std::wstring & s);
virtual Log & operator<<(char s);
virtual Log & operator<<(unsigned char);
virtual Log & operator<<(wchar_t s);
virtual Log & operator<<(bool);
virtual Log & operator<<(short);
virtual Log & operator<<(int s); virtual Log & operator<<(int s);
virtual Log & operator<<(long s); virtual Log & operator<<(long s);
virtual Log & operator<<(char s); virtual Log & operator<<(long long);
virtual Log & operator<<(wchar_t s); virtual Log & operator<<(unsigned short);
virtual Log & operator<<(size_t s); virtual Log & operator<<(unsigned int);
virtual Log & operator<<(unsigned long);
virtual Log & operator<<(unsigned long long);
virtual Log & operator<<(float);
virtual Log & operator<<(double s); virtual Log & operator<<(double s);
virtual Log & operator<<(long double);
virtual Log & operator<<(const pt::Stream & stream);
virtual Log & operator<<(const pt::Space & space); virtual Log & operator<<(const pt::Space & space);
virtual Log & operator<<(const pt::Date & date);
virtual Log & operator<<(LogManipulators m); virtual Log & operator<<(LogManipulators m);
virtual Log & operator<<(pt::Log::Manipulators m); virtual Log & operator<<(pt::Log::Manipulators m);
virtual Log & operator<<(const pt::Date & date);
virtual Log & operator<<(morm::Model & model); virtual Log & operator<<(morm::Model & model);
virtual void PrintDate(const pt::Date & date); virtual void PrintDate(const pt::Date & date);
template<typename char_type, size_t stack_size, size_t heap_block_size> template<typename char_type, size_t stack_size, size_t heap_block_size>