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

Namespaces

namespace  __get_put_time_emulation
namespace  anonymous_namespace{Time.cpp}

Classes

struct  HexFile
struct  SerialPortInfo
class  Serial
struct  SerialMessage
class  TCPConsole

Enumerations

enum class  TimeZone { local , utc }
enum class  TimeFormat { gcode , iso8601Z }
enum  SerialMessageType { Command , Data }

Functions

static const char * get_fmtstr (TimeFormat fmt)
time_t get_current_time_utc ()
static std::string tm2str (const std::tm *tms, const char *fmt)
std::string time2str (const time_t &t, TimeZone zone, TimeFormat fmt)
static time_t str2time (std::istream &stream, TimeZone zone, const char *fmt)
time_t str2time (const std::string &str, TimeZone zone, TimeFormat fmt)
std::string millis_to_iso8601 (long long unix_millis)
long long iso8601_to_millis (const std::string &iso_time)
std::string time2str (TimeZone zone, TimeFormat fmt)
std::string utc_timestamp (time_t t)
std::string utc_timestamp ()
std::string local_timestamp (TimeFormat fmt=TimeFormat::gcode)
std::string iso_utc_timestamp (time_t t)
std::string iso_utc_timestamp ()
time_t parse_iso_utc_timestamp (const std::string &str)
bool is_file_too_large (std::string file_path, bool &try_ok)
void slash_to_back_slash (std::string &file_path)
static HexFile::DeviceKind parse_device_kind (const std::string &str)
static size_t hex_num_sections (fs::ifstream &file)
static bool looks_like_printer (const std::string &friendly_name)
std::vector< SerialPortInfo > scan_serial_ports_extended ()
std::vector< std::string > scan_serial_ports ()
bool operator== (const SerialPortInfo &sp1, const SerialPortInfo &sp2)

Variables

static const constexpr char *const SLICER_UTC_TIME_FMT = "%Y-%m-%d at %T"
static const constexpr char *const ISO8601Z_TIME_FMT = "%Y%m%dT%H%M%SZ"

Enumeration Type Documentation

◆ SerialMessageType

Enumerator
Command 
Data 
6{ Command, Data };
@ Command
Definition SerialMessageType.hpp:6
@ Data
Definition SerialMessageType.hpp:6

◆ TimeFormat

enum class Slic3r::Utils::TimeFormat
strong
Enumerator
gcode 
iso8601Z 
14{ gcode, iso8601Z };
@ gcode
Definition Time.hpp:14
@ iso8601Z
Definition Time.hpp:14

◆ TimeZone

enum class Slic3r::Utils::TimeZone
strong
Enumerator
local 
utc 
13{ local, utc };
@ utc
Definition Time.hpp:13
@ local
Definition Time.hpp:13

Function Documentation

◆ get_current_time_utc()

time_t Slic3r::Utils::get_current_time_utc ( )
184{
185 using clk = std::chrono::system_clock;
186 return clk::to_time_t(clk::now());
187}

Referenced by Slic3r::DeviceManager::insert_local_device(), iso_utc_timestamp(), Slic3r::DeviceManager::load_local_machines_from_config(), local_timestamp(), Slic3r::DeviceManager::on_machine_alive(), Slic3r::CLI::run(), Slic3r::GUI::Config::SnapshotDB::take_snapshot(), time2str(), and utc_timestamp().

Here is the caller graph for this function:

◆ get_fmtstr()

const char * Slic3r::Utils::get_fmtstr ( TimeFormat fmt)
static
36{
37 switch (fmt) {
40 }
41
42 return "";
43}
static const constexpr char *const SLICER_UTC_TIME_FMT
Definition Time.cpp:30
static const constexpr char *const ISO8601Z_TIME_FMT
Definition Time.cpp:33

References gcode, iso8601Z, ISO8601Z_TIME_FMT, and SLICER_UTC_TIME_FMT.

Referenced by str2time(), and time2str().

Here is the caller graph for this function:

◆ hex_num_sections()

size_t Slic3r::Utils::hex_num_sections ( fs::ifstream & file)
static
33{
34 file.seekg(0);
35 if (! file.good()) {
36 return 0;
37 }
38
39 static const char *hex_terminator = ":00000001FF\r";
40 size_t res = 0;
41 std::string line;
42 while (getline(file, line, '\n').good()) {
43 // Account for LF vs CRLF
44 if (!line.empty() && line.back() != '\r') {
45 line.push_back('\r');
46 }
47
48 if (line == hex_terminator) {
49 res++;
50 }
51 }
52
53 return res;
54}

◆ is_file_too_large()

bool Slic3r::Utils::is_file_too_large ( std::string file_path,
bool & try_ok )
13{
14 try {
15 uintmax_t fileSizeBytes = boost::filesystem::file_size(file_path);
16 double fileSizeMB = static_cast<double>(fileSizeBytes) / 1024 / 1024;
17 try_ok = true;
18 if (fileSizeMB > STL_SVG_MAX_FILE_SIZE_MB) { return true; }
19 } catch (boost::filesystem::filesystem_error &e) {
20 try_ok = false;
21 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " error message: " << e.what();
22 }
23 return false;
24}
#define STL_SVG_MAX_FILE_SIZE_MB
Definition FileHelp.hpp:5

References STL_SVG_MAX_FILE_SIZE_MB.

Referenced by Slic3r::GUI::CreatePrinterPresetDialog::load_model_stl(), and Slic3r::GUI::CreatePrinterPresetDialog::load_texture().

Here is the caller graph for this function:

◆ iso8601_to_millis()

long long Slic3r::Utils::iso8601_to_millis ( const std::string & iso_time)
266{
267 if (iso_time.empty()) return -1;
268
269 int y, M, d, h, m, s, ms = 0;
270
271 // Try parsing with milliseconds: "2025-11-28T14:30:00.123Z"
272 int parsed = sscanf(iso_time.c_str(), "%d-%d-%dT%d:%d:%d.%dZ",
273 &y, &M, &d, &h, &m, &s, &ms);
274
275 if (parsed < 6) {
276 // Try without milliseconds: "2025-11-28T14:30:00Z"
277 parsed = sscanf(iso_time.c_str(), "%d-%d-%dT%d:%d:%dZ",
278 &y, &M, &d, &h, &m, &s);
279 ms = 0;
280 }
281
282 if (parsed < 6) return -1;
283
284 // Normalize milliseconds (handle .1, .12, .123, .1234, etc.)
285 if (parsed >= 7) {
286 // Count digits in the fractional part to normalize
287 const char* dot = strchr(iso_time.c_str(), '.');
288 if (dot) {
289 int digits = 0;
290 for (const char* p = dot + 1; *p && *p != 'Z' && std::isdigit(*p); ++p)
291 digits++;
292 // Normalize to 3 digits (milliseconds)
293 while (digits < 3) { ms *= 10; digits++; }
294 while (digits > 3) { ms /= 10; digits--; }
295 }
296 }
297
298 std::tm tms = {};
299 tms.tm_year = y - 1900;
300 tms.tm_mon = M - 1;
301 tms.tm_mday = d;
302 tms.tm_hour = h;
303 tms.tm_min = m;
304 tms.tm_sec = s;
305
306 time_t seconds = _timegm(&tms);
307 if (seconds == time_t(-1)) return -1;
308
309 return static_cast<long long>(seconds) * 1000 + ms;
310}
time_t _timegm(const struct std::tm *tms)
Definition Time.cpp:161
T dot(const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
Definition ExtrusionSimulator.cpp:154

References Slic3r::dot().

Here is the call graph for this function:

◆ iso_utc_timestamp() [1/2]

std::string Slic3r::Utils::iso_utc_timestamp ( )
inline
57{
59}
std::string iso_utc_timestamp()
Definition Time.hpp:56
time_t get_current_time_utc()
Definition Time.cpp:183

References get_current_time_utc(), and iso_utc_timestamp().

Referenced by iso_utc_timestamp(), Slic3r::GUI::Config::Snapshot::save_ini(), and Slic3r::GUI::Config::SnapshotDB::take_snapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iso_utc_timestamp() [2/2]

std::string Slic3r::Utils::iso_utc_timestamp ( time_t t)
inline
52{
54}
std::string time2str(const time_t &t, TimeZone zone, TimeFormat fmt)
Definition Time.cpp:197

References iso8601Z, time2str(), and utc.

Here is the call graph for this function:

◆ local_timestamp()

std::string Slic3r::Utils::local_timestamp ( TimeFormat fmt = TimeFormat::gcode)
inline
35 {
37}

References gcode, get_current_time_utc(), local, and time2str().

Referenced by Slic3r::GCode::_do_export().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ looks_like_printer()

bool Slic3r::Utils::looks_like_printer ( const std::string & friendly_name)
static
78{
79 return friendly_name.find("Original Prusa") != std::string::npos;
80}

Referenced by scan_serial_ports_extended().

Here is the caller graph for this function:

◆ millis_to_iso8601()

std::string Slic3r::Utils::millis_to_iso8601 ( long long unix_millis)
245{
246 time_t seconds = static_cast<time_t>(unix_millis / 1000);
247 int millis = static_cast<int>(unix_millis % 1000);
248
249 std::tm tms = {};
250 _gmtime_r(&seconds, &tms);
251
252 char buf[32];
253 std::snprintf(buf, sizeof(buf), "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ",
254 tms.tm_year + 1900,
255 tms.tm_mon + 1,
256 tms.tm_mday,
257 tms.tm_hour,
258 tms.tm_min,
259 tms.tm_sec,
260 millis);
261
262 return std::string(buf);
263}

◆ operator==()

bool Slic3r::Utils::operator== ( const SerialPortInfo & sp1,
const SerialPortInfo & sp2 )
inline
30{
31 return
32 sp1.port == sp2.port &&
33 sp1.id_vendor == sp2.id_vendor &&
34 sp1.id_product == sp2.id_product &&
35 sp1.is_printer == sp2.is_printer;
36}
std::string port
Definition Serial.hpp:17
unsigned id_product
Definition Serial.hpp:19
bool is_printer
Definition Serial.hpp:21
unsigned id_vendor
Definition Serial.hpp:18

References Slic3r::Utils::SerialPortInfo::id_product, Slic3r::Utils::SerialPortInfo::id_vendor, Slic3r::Utils::SerialPortInfo::is_printer, and Slic3r::Utils::SerialPortInfo::port.

◆ parse_device_kind()

HexFile::DeviceKind Slic3r::Utils::parse_device_kind ( const std::string & str)
static
23{
24 if (str == "mk2") { return HexFile::DEV_MK2; }
25 else if (str == "mk3") { return HexFile::DEV_MK3; }
26 else if (str == "mm-control") { return HexFile::DEV_MM_CONTROL; }
27 else if (str == "cw1") { return HexFile::DEV_CW1; }
28 else if (str == "cw1s") { return HexFile::DEV_CW1S; }
29 else { return HexFile::DEV_GENERIC; }
30}
@ DEV_CW1S
Definition HexFile.hpp:20
@ DEV_CW1
Definition HexFile.hpp:19
@ DEV_MM_CONTROL
Definition HexFile.hpp:18
@ DEV_MK3
Definition HexFile.hpp:17
@ DEV_MK2
Definition HexFile.hpp:16
@ DEV_GENERIC
Definition HexFile.hpp:15

References Slic3r::Utils::HexFile::DEV_CW1, Slic3r::Utils::HexFile::DEV_CW1S, Slic3r::Utils::HexFile::DEV_GENERIC, Slic3r::Utils::HexFile::DEV_MK2, Slic3r::Utils::HexFile::DEV_MK3, and Slic3r::Utils::HexFile::DEV_MM_CONTROL.

◆ parse_iso_utc_timestamp()

time_t Slic3r::Utils::parse_iso_utc_timestamp ( const std::string & str)
inline
62{
64}
static time_t str2time(std::istream &stream, TimeZone zone, const char *fmt)
Definition Time.cpp:214

References iso8601Z, str2time(), and utc.

Referenced by Slic3r::GUI::Config::Snapshot::load_ini().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scan_serial_ports()

std::vector< std::string > Slic3r::Utils::scan_serial_ports ( )
277{
278 std::vector<SerialPortInfo> ports = scan_serial_ports_extended();
279 std::vector<std::string> output;
280 output.reserve(ports.size());
281 for (const SerialPortInfo &spi : ports)
282 output.emplace_back(std::move(spi.port));
283 return output;
284}
std::vector< SerialPortInfo > scan_serial_ports_extended()
Definition Serial.cpp:119
Definition Serial.hpp:16

References scan_serial_ports_extended().

Here is the call graph for this function:

◆ scan_serial_ports_extended()

std::vector< SerialPortInfo > Slic3r::Utils::scan_serial_ports_extended ( )
120{
121 std::vector<SerialPortInfo> output;
122
123#ifdef _WIN32
124 SP_DEVINFO_DATA devInfoData = { 0 };
125 devInfoData.cbSize = sizeof(devInfoData);
126 // Get the tree containing the info for the ports.
127 HDEVINFO hDeviceInfo = SetupDiGetClassDevs(&GUID_DEVCLASS_PORTS, 0, nullptr, DIGCF_PRESENT);
128 if (hDeviceInfo != INVALID_HANDLE_VALUE) {
129 // Iterate over all the devices in the tree.
130 for (int nDevice = 0; SetupDiEnumDeviceInfo(hDeviceInfo, nDevice, &devInfoData); ++ nDevice) {
131 SerialPortInfo port_info;
132 // Get the registry key which stores the ports settings.
133 HKEY hDeviceKey = SetupDiOpenDevRegKey(hDeviceInfo, &devInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DEV, KEY_QUERY_VALUE);
134 if (hDeviceKey) {
135 // Read in the name of the port.
136 wchar_t pszPortName[4096];
137 DWORD dwSize = sizeof(pszPortName);
138 DWORD dwType = 0;
139 if (RegQueryValueEx(hDeviceKey, L"PortName", NULL, &dwType, (LPBYTE)pszPortName, &dwSize) == ERROR_SUCCESS)
140 port_info.port = boost::nowide::narrow(pszPortName);
141 RegCloseKey(hDeviceKey);
142 if (port_info.port.empty())
143 continue;
144 }
145
146 // Find the size required to hold the device info.
147 DWORD regDataType;
148 DWORD reqSize = 0;
149 SetupDiGetDeviceRegistryProperty(hDeviceInfo, &devInfoData, SPDRP_HARDWAREID, nullptr, nullptr, 0, &reqSize);
150 std::vector<wchar_t> hardware_id(reqSize > 1 ? reqSize : 1);
151 // Now store it in a buffer.
152 if (! SetupDiGetDeviceRegistryProperty(hDeviceInfo, &devInfoData, SPDRP_HARDWAREID, &regDataType, (BYTE*)hardware_id.data(), reqSize, nullptr))
153 continue;
154 parse_hardware_id(boost::nowide::narrow(hardware_id.data()), port_info);
155
156 // Find the size required to hold the friendly name.
157 reqSize = 0;
158 SetupDiGetDeviceRegistryProperty(hDeviceInfo, &devInfoData, SPDRP_FRIENDLYNAME, nullptr, nullptr, 0, &reqSize);
159 std::vector<wchar_t> friendly_name;
160 friendly_name.reserve(reqSize > 1 ? reqSize : 1);
161 // Now store it in a buffer.
162 if (! SetupDiGetDeviceRegistryProperty(hDeviceInfo, &devInfoData, SPDRP_FRIENDLYNAME, nullptr, (BYTE*)friendly_name.data(), reqSize, nullptr)) {
163 port_info.friendly_name = port_info.port;
164 } else {
165 port_info.friendly_name = boost::nowide::narrow(friendly_name.data());
166 port_info.is_printer = looks_like_printer(port_info.friendly_name);
167 }
168 output.emplace_back(std::move(port_info));
169 }
170 }
171#elif __APPLE__
172 // inspired by https://sigrok.org/wiki/Libserialport
173 CFMutableDictionaryRef classes = IOServiceMatching(kIOSerialBSDServiceValue);
174 if (classes != 0) {
175 io_iterator_t iter;
176 if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes, &iter) == KERN_SUCCESS) {
177 io_object_t port;
178 while ((port = IOIteratorNext(iter)) != 0) {
179 CFTypeRef cf_property = IORegistryEntryCreateCFProperty(port, CFSTR(kIOCalloutDeviceKey), kCFAllocatorDefault, 0);
180 if (cf_property) {
181 char path[PATH_MAX];
182 Boolean result = CFStringGetCString((CFStringRef)cf_property, path, sizeof(path), kCFStringEncodingUTF8);
183 CFRelease(cf_property);
184 if (result) {
185 SerialPortInfo port_info;
186 port_info.port = path;
187
188 // Attempt to read out the device friendly name
189 if ((cf_property = IORegistryEntrySearchCFProperty(port, kIOServicePlane,
190 CFSTR("USB Interface Name"), kCFAllocatorDefault,
191 kIORegistryIterateRecursively | kIORegistryIterateParents)) ||
192 (cf_property = IORegistryEntrySearchCFProperty(port, kIOServicePlane,
193 CFSTR("USB Product Name"), kCFAllocatorDefault,
194 kIORegistryIterateRecursively | kIORegistryIterateParents)) ||
195 (cf_property = IORegistryEntrySearchCFProperty(port, kIOServicePlane,
196 CFSTR("Product Name"), kCFAllocatorDefault,
197 kIORegistryIterateRecursively | kIORegistryIterateParents)) ||
198 (cf_property = IORegistryEntryCreateCFProperty(port,
199 CFSTR(kIOTTYDeviceKey), kCFAllocatorDefault, 0))) {
200 // Description limited to 127 char, anything longer would not be user friendly anyway.
201 char description[128];
202 if (CFStringGetCString((CFStringRef)cf_property, description, sizeof(description), kCFStringEncodingUTF8)) {
203 port_info.friendly_name = std::string(description) + " (" + port_info.port + ")";
204 port_info.is_printer = looks_like_printer(port_info.friendly_name);
205 }
206 CFRelease(cf_property);
207 }
208 if (port_info.friendly_name.empty())
209 port_info.friendly_name = port_info.port;
210
211 // Attempt to read out the VID & PID
212 int vid, pid;
213 auto cf_vendor = IORegistryEntrySearchCFProperty(port, kIOServicePlane, CFSTR("idVendor"),
214 kCFAllocatorDefault, kIORegistryIterateRecursively | kIORegistryIterateParents);
215 auto cf_product = IORegistryEntrySearchCFProperty(port, kIOServicePlane, CFSTR("idProduct"),
216 kCFAllocatorDefault, kIORegistryIterateRecursively | kIORegistryIterateParents);
217 if (cf_vendor && cf_product) {
218 if (CFNumberGetValue((CFNumberRef)cf_vendor, kCFNumberIntType, &vid) &&
219 CFNumberGetValue((CFNumberRef)cf_product, kCFNumberIntType, &pid)) {
220 port_info.id_vendor = vid;
221 port_info.id_product = pid;
222 }
223 }
224 if (cf_vendor) { CFRelease(cf_vendor); }
225 if (cf_product) { CFRelease(cf_product); }
226
227 output.emplace_back(std::move(port_info));
228 }
229 }
230 IOObjectRelease(port);
231 }
232 }
233 }
234#else
235 // UNIX / Linux
236 std::initializer_list<const char*> prefixes { "ttyUSB" , "ttyACM", "tty.", "cu.", "rfcomm" };
237 for (auto &dir_entry : boost::filesystem::directory_iterator(boost::filesystem::path("/dev"))) {
238 std::string name = dir_entry.path().filename().string();
239 for (const char *prefix : prefixes) {
240 if (boost::starts_with(name, prefix)) {
241 const auto path = dir_entry.path().string();
242 SerialPortInfo spi;
243 spi.port = path;
244#ifdef __linux__
245 auto friendly_name = sysfs_tty_prop(name, "product");
246 if (friendly_name) {
247 spi.is_printer = looks_like_printer(*friendly_name);
248 spi.friendly_name = (boost::format("%1% (%2%)") % *friendly_name % path).str();
249 } else {
250 spi.friendly_name = path;
251 }
252 auto vid = sysfs_tty_prop_hex(name, "idVendor");
253 auto pid = sysfs_tty_prop_hex(name, "idProduct");
254 if (vid && pid) {
255 spi.id_vendor = *vid;
256 spi.id_product = *pid;
257 }
258#else
259 spi.friendly_name = path;
260#endif
261 output.emplace_back(std::move(spi));
262 break;
263 }
264 }
265 }
266#endif
267
268 output.erase(std::remove_if(output.begin(), output.end(),
269 [](const SerialPortInfo &info) {
270 return boost::starts_with(info.port, "Bluetooth") || boost::starts_with(info.port, "FireFly");
271 }),
272 output.end());
273 return output;
274}
#define L(s)
Definition ExtrusionEntity.cpp:25
static bool looks_like_printer(const std::string &friendly_name)
Definition Serial.cpp:77
@ Boolean
Definition CadDocument.hpp:26

References Slic3r::Boolean, Slic3r::Utils::SerialPortInfo::friendly_name, Slic3r::Utils::SerialPortInfo::id_product, Slic3r::Utils::SerialPortInfo::id_vendor, Slic3r::Utils::SerialPortInfo::is_printer, L, looks_like_printer(), and Slic3r::Utils::SerialPortInfo::port.

Referenced by scan_serial_ports().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slash_to_back_slash()

void Slic3r::Utils::slash_to_back_slash ( std::string & file_path)
26 {
27 std::replace(file_path.begin(), file_path.end(), '\\', '/');
28}

Referenced by Slic3r::GUI::GLTexture::load_from_svg_file(), Slic3r::GUI::CreatePrinterPresetDialog::save_printable_area_config(), and Slic3r::GUI::PartPlateList::update_logo_texture_filename().

Here is the caller graph for this function:

◆ str2time() [1/2]

time_t Slic3r::Utils::str2time ( const std::string & str,
TimeZone zone,
TimeFormat fmt )
233{
234 std::string fmtstr = process_format(get_fmtstr(fmt), zone).c_str();
235 std::stringstream ss(str);
236
237 ss.imbue(std::locale("C"));
238 return str2time(ss, zone, fmtstr.c_str());
239}
static const char * get_fmtstr(TimeFormat fmt)
Definition Time.cpp:35

References get_fmtstr(), and str2time().

Here is the call graph for this function:

◆ str2time() [2/2]

time_t Slic3r::Utils::str2time ( std::istream & stream,
TimeZone zone,
const char * fmt )
static
215{
216 std::tm tms = {};
217 tms.tm_isdst = -1;
218
219 stream >> __get_put_time_emulation::get_time(&tms, fmt);
220 time_t ret = time_t(-1);
221
222 switch (zone) {
223 case TimeZone::local: ret = _mktime(&tms); break;
224 case TimeZone::utc: ret = _timegm(&tms); break;
225 }
226
227 if (stream.fail() || ret < time_t(0)) ret = time_t(-1);
228
229 return ret;
230}
GetTimeReturnT get_time(std::tm *tms, const char *fmt)
Definition Time.cpp:116

References Slic3r::Utils::__get_put_time_emulation::get_time(), local, and utc.

Referenced by parse_iso_utc_timestamp(), and str2time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ time2str() [1/2]

std::string Slic3r::Utils::time2str ( const time_t & t,
TimeZone zone,
TimeFormat fmt )
198{
199 std::string ret;
200 std::tm tms = {};
201 tms.tm_isdst = -1;
202 std::string fmtstr = process_format(get_fmtstr(fmt), zone);
203
204 switch (zone) {
205 case TimeZone::local:
206 ret = tm2str(_localtime_r(&t, &tms), fmtstr.c_str()); break;
207 case TimeZone::utc:
208 ret = tm2str(_gmtime_r(&t, &tms), fmtstr.c_str()); break;
209 }
210
211 return ret;
212}
static std::string tm2str(const std::tm *tms, const char *fmt)
Definition Time.cpp:189

References get_fmtstr(), local, tm2str(), and utc.

Referenced by iso_utc_timestamp(), local_timestamp(), Slic3r::PresetBundle::migrate_legacy_user_filament_presets(), time2str(), and utc_timestamp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ time2str() [2/2]

std::string Slic3r::Utils::time2str ( TimeZone zone,
TimeFormat fmt )
inline
21{
22 return time2str(get_current_time_utc(), zone, fmt);
23}

References get_current_time_utc(), and time2str().

Here is the call graph for this function:

◆ tm2str()

std::string Slic3r::Utils::tm2str ( const std::tm * tms,
const char * fmt )
static
190{
191 std::stringstream ss;
192 ss.imbue(std::locale("C"));
194 return ss.str();
195}
PutTimeReturnT put_time(const std::tm *tms, const char *fmt)
Definition Time.cpp:100

References Slic3r::Utils::__get_put_time_emulation::put_time().

Referenced by time2str().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ utc_timestamp() [1/2]

std::string Slic3r::Utils::utc_timestamp ( )
inline
31{
33}
std::string utc_timestamp()
Definition Time.hpp:30

References get_current_time_utc(), and utc_timestamp().

Referenced by utc_timestamp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ utc_timestamp() [2/2]

std::string Slic3r::Utils::utc_timestamp ( time_t t)
inline
26{
28}

References gcode, time2str(), and utc.

Referenced by Slic3r::anonymous_namespace{SL1.cpp}::fill_iniconf().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ISO8601Z_TIME_FMT

const constexpr char* const Slic3r::Utils::ISO8601Z_TIME_FMT = "%Y%m%dT%H%M%SZ"
staticconstexpr

Referenced by get_fmtstr().

◆ SLICER_UTC_TIME_FMT

const constexpr char* const Slic3r::Utils::SLICER_UTC_TIME_FMT = "%Y-%m-%d at %T"
staticconstexpr