WIP: Time estimate in file names.

This commit is contained in:
bubnikv 2018-12-12 12:00:45 +01:00
parent 2b9f52c33c
commit c0ebcacf1d
6 changed files with 53 additions and 11 deletions

View file

@ -48,12 +48,14 @@ void PrintBase::update_object_placeholders()
}
}
std::string PrintBase::output_filename(const std::string &format, const std::string &default_ext) const
std::string PrintBase::output_filename(const std::string &format, const std::string &default_ext, const DynamicConfig *config_override) const
{
DynamicConfig cfg_timestamp;
PlaceholderParser::update_timestamp(cfg_timestamp);
DynamicConfig cfg;
if (config_override != nullptr)
cfg = *config_override;
PlaceholderParser::update_timestamp(cfg);
try {
boost::filesystem::path filename = this->placeholder_parser().process(format, 0, &cfg_timestamp);
boost::filesystem::path filename = this->placeholder_parser().process(format, 0, &cfg);
if (filename.extension().empty())
filename = boost::filesystem::change_extension(filename, default_ext);
return filename.string();