mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
New C++ class AppConfig for maintaining the config.ini
New helper function for generating a unified "generated by slic3r" header.
This commit is contained in:
parent
835e5b71a8
commit
1fee3633a0
11 changed files with 107 additions and 51 deletions
|
@ -1,6 +1,6 @@
|
|||
#include "Config.hpp"
|
||||
#include "Utils.hpp"
|
||||
#include <assert.h>
|
||||
#include <ctime>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <exception> // std::runtime_error
|
||||
|
@ -422,13 +422,7 @@ void ConfigBase::save(const std::string &file) const
|
|||
{
|
||||
boost::nowide::ofstream c;
|
||||
c.open(file, std::ios::out | std::ios::trunc);
|
||||
{
|
||||
std::time_t now;
|
||||
time(&now);
|
||||
char buf[sizeof "0000-00-00 00:00:00"];
|
||||
strftime(buf, sizeof(buf), "%F %T", gmtime(&now));
|
||||
c << "# generated by Slic3r " << SLIC3R_VERSION << " on " << buf << std::endl;
|
||||
}
|
||||
c << "# " << Slic3r::header_slic3r_generated() << std::endl;
|
||||
for (const std::string &opt_key : this->keys())
|
||||
c << opt_key << " = " << this->serialize(opt_key) << std::endl;
|
||||
c.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue