#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.hpp>
◆ GCodeOutputStream()
| Slic3r::GCode::GCodeOutputStream::GCodeOutputStream |
( |
FILE * | f, |
|
|
GCodeProcessor & | processor ) |
|
inline |
FILE * f
Definition GCode.hpp:435
GCodeProcessor & m_processor
Definition GCode.hpp:436
References f, and m_processor.
◆ ~GCodeOutputStream()
| Slic3r::GCode::GCodeOutputStream::~GCodeOutputStream |
( |
| ) |
|
|
inline |
void close()
Definition GCode.cpp:9063
References close().
◆ close()
| void Slic3r::GCode::GCodeOutputStream::close |
( |
| ) |
|
◆ flush()
| void Slic3r::GCode::GCodeOutputStream::flush |
( |
| ) |
|
◆ is_error()
| bool Slic3r::GCode::GCodeOutputStream::is_error |
( |
| ) |
const |
◆ is_open()
| bool Slic3r::GCode::GCodeOutputStream::is_open |
( |
| ) |
const |
|
inline |
◆ write() [1/2]
| void Slic3r::GCode::GCodeOutputStream::write |
( |
const char * | what | ) |
|
9072{
9073 if (what != nullptr) {
9074 const char*
gcode = what;
9075
9076 fwrite(gcode, 1, ::strlen(gcode), this->
f);
9077
9079 }
9080}
@ gcode
Definition Time.hpp:14
References f, and m_processor.
◆ write() [2/2]
| void Slic3r::GCode::GCodeOutputStream::write |
( |
const std::string & | what | ) |
|
|
inline |
◆ write_format()
| void Slic3r::GCode::GCodeOutputStream::write_format |
( |
const char * | format, |
|
|
| ... ) |
9089{
9090 va_list args;
9092
9093 int buflen;
9094 {
9095 va_list args2;
9096 va_copy(args2, args);
9097 buflen =
9098 #ifdef _MSC_VER
9099 ::_vscprintf(
format, args2)
9100 #else
9101 ::vsnprintf(
nullptr, 0,
format, args2)
9102 #endif
9103 + 1;
9104 va_end(args2);
9105 }
9106
9107 char buffer[1024];
9108 bool buffer_dynamic = buflen > 1024;
9109 char *bufptr = buffer_dynamic ? (char*)malloc(buflen) : buffer;
9110 int res = ::vsnprintf(bufptr, buflen,
format, args);
9111 if (res > 0)
9112 this->
write(bufptr);
9113
9114 if (buffer_dynamic)
9115 free(bufptr);
9116
9117 va_end(args);
9118}
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:45
References Slic3r::format(), and write().
Referenced by Slic3r::GCode::_do_export(), Slic3r::GCode::print_machine_envelope(), and Slic3r::BeltGCode::write_belt_header().
◆ writeln()
| void Slic3r::GCode::GCodeOutputStream::writeln |
( |
const std::string & | what | ) |
|
| FILE* Slic3r::GCode::GCodeOutputStream::f = nullptr |
|
private |
◆ m_processor
The documentation for this class was generated from the following files:
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.hpp
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/GCode.cpp