Fixed operator << warnings.
the build was successful
Details
the build was successful
Details
This commit is contained in:
parent
d3d9f0f4e4
commit
2287a4753c
|
@ -16,20 +16,22 @@
|
||||||
|
|
||||||
#include "types_easy.hpp"
|
#include "types_easy.hpp"
|
||||||
|
|
||||||
using namespace Mastodon;
|
namespace Mastodon
|
||||||
|
|
||||||
Easy::time::operator const system_clock::time_point() const
|
|
||||||
{
|
{
|
||||||
|
namespace Easy
|
||||||
|
{
|
||||||
|
time::operator const system_clock::time_point() const
|
||||||
|
{
|
||||||
return timepoint;
|
return timepoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
Easy::time::operator const string() const
|
time::operator const string() const
|
||||||
{
|
{
|
||||||
return strtime("%FT%T%z", true);
|
return strtime("%FT%T%z", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
const string Easy::time::strtime(const string &format, const bool &local) const
|
const string time::strtime(const string &format, const bool &local) const
|
||||||
{
|
{
|
||||||
constexpr std::uint16_t bufsize = 1024;
|
constexpr std::uint16_t bufsize = 1024;
|
||||||
std::time_t time = system_clock::to_time_t(timepoint);
|
std::time_t time = system_clock::to_time_t(timepoint);
|
||||||
std::tm *tm;
|
std::tm *tm;
|
||||||
|
@ -46,12 +48,14 @@ const string Easy::time::strtime(const string &format, const bool &local) const
|
||||||
std::strftime(buffer, bufsize, format.c_str(), tm);
|
std::strftime(buffer, bufsize, format.c_str(), tm);
|
||||||
|
|
||||||
return static_cast<const string>(buffer);
|
return static_cast<const string>(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &Mastodon::Easy::operator <<(std::ostream &out,
|
std::ostream &operator <<(std::ostream &out,
|
||||||
const Easy::time &t)
|
const time &t)
|
||||||
{
|
{
|
||||||
const string s = t; // Converts using operator const string().
|
const string s = t; // Converts using operator const string().
|
||||||
out << s;
|
out << s;
|
||||||
return out;
|
return out;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
#include "return_types.hpp"
|
#include "return_types.hpp"
|
||||||
|
|
||||||
using namespace Mastodon;
|
namespace Mastodon
|
||||||
|
|
||||||
return_base::operator bool()
|
|
||||||
{
|
{
|
||||||
|
return_base::operator bool()
|
||||||
|
{
|
||||||
if (error_code == 0)
|
if (error_code == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -28,32 +28,33 @@ return_base::operator bool()
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return_base::operator uint8_t()
|
return_base::operator uint8_t()
|
||||||
{
|
{
|
||||||
return error_code;
|
return error_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
return_call::operator const string() const
|
return_call::operator const string() const
|
||||||
{
|
{
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &Mastodon::operator <<(std::ostream &out, const return_call &ret)
|
std::ostream &operator <<(std::ostream &out, const return_call &ret)
|
||||||
{
|
{
|
||||||
out << ret.answer;
|
out << ret.answer;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
return_call::return_call()
|
return_call::return_call()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
return_call::return_call(const uint8_t ec, const string &em,
|
return_call::return_call(const uint8_t ec, const string &em,
|
||||||
const uint16_t hec, const string &a)
|
const uint16_t hec, const string &a)
|
||||||
: answer(a)
|
: answer(a)
|
||||||
{
|
{
|
||||||
error_code = ec;
|
error_code = ec;
|
||||||
error_message = em;
|
error_message = em;
|
||||||
http_error_code = hec;
|
http_error_code = hec;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue