mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -06:00
Merge branch 'main' into enh-port-edit-gcode-dlg
This commit is contained in:
commit
a8c3377d9b
36 changed files with 156 additions and 304 deletions
|
@ -1539,4 +1539,22 @@ void copy_directory_recursively(const boost::filesystem::path &source, const boo
|
|||
return;
|
||||
}
|
||||
|
||||
void save_string_file(const boost::filesystem::path& p, const std::string& str)
|
||||
{
|
||||
boost::nowide::ofstream file;
|
||||
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
||||
file.open(p.generic_string(), std::ios_base::binary);
|
||||
file.write(str.c_str(), str.size());
|
||||
}
|
||||
|
||||
void load_string_file(const boost::filesystem::path& p, std::string& str)
|
||||
{
|
||||
boost::nowide::ifstream file;
|
||||
file.exceptions(std::ios_base::failbit | std::ios_base::badbit);
|
||||
file.open(p.generic_string(), std::ios_base::binary);
|
||||
std::size_t sz = static_cast<std::size_t>(boost::filesystem::file_size(p));
|
||||
str.resize(sz, '\0');
|
||||
file.read(&str[0], sz);
|
||||
}
|
||||
|
||||
}; // namespace Slic3r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue