OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Utils::__get_put_time_emulation Namespace Reference

Classes

struct  GetPutTimeReturnT

Typedefs

using GetTimeReturnT = GetPutTimeReturnT<std::tm>
using PutTimeReturnT = GetPutTimeReturnT<const std::tm>

Functions

std::ostream & operator<< (std::ostream &stream, PutTimeReturnT &&pt)
PutTimeReturnT put_time (const std::tm *tms, const char *fmt)
std::istream & operator>> (std::istream &stream, GetTimeReturnT &&gt)
GetTimeReturnT get_time (std::tm *tms, const char *fmt)

Typedef Documentation

◆ GetTimeReturnT

◆ PutTimeReturnT

Function Documentation

◆ get_time()

GetTimeReturnT Slic3r::Utils::__get_put_time_emulation::get_time ( std::tm * tms,
const char * fmt )
inline
117{
118 return {tms, fmt};
119}

Referenced by Slic3r::Utils::str2time().

Here is the caller graph for this function:

◆ operator<<()

std::ostream & Slic3r::Utils::__get_put_time_emulation::operator<< ( std::ostream & stream,
PutTimeReturnT && pt )
92{
93 static const constexpr int MAX_CHARS = 200;
94 char _out[MAX_CHARS];
95 strftime(_out, MAX_CHARS, pt.fmt, pt.tms);
96 stream << _out;
97 return stream;
98}

◆ operator>>()

std::istream & Slic3r::Utils::__get_put_time_emulation::operator>> ( std::istream & stream,
GetTimeReturnT && gt )
106{
107 std::string line;
108 std::getline(stream, line);
109
110 if (strptime(line.c_str(), gt.fmt, gt.tms) == nullptr)
111 stream.setstate(std::ios::failbit);
112
113 return stream;
114}

◆ put_time()

PutTimeReturnT Slic3r::Utils::__get_put_time_emulation::put_time ( const std::tm * tms,
const char * fmt )
inline
101{
102 return {tms, fmt};
103}

Referenced by Slic3r::Utils::tm2str().

Here is the caller graph for this function: