File: Make path a first-class object, add some methods from C++17.

This commit is contained in:
Jared Boone 2016-09-08 12:57:34 -07:00
parent f80706cb34
commit b87d1456a2
4 changed files with 166 additions and 39 deletions

View file

@ -81,13 +81,13 @@ void SystemStatusView::set_title(const std::string new_value) {
}
void SystemStatusView::on_camera() {
const auto filename_stem = next_filename_stem_matching_pattern(u"SCR_????");
if( filename_stem.empty() ) {
auto path = next_filename_stem_matching_pattern(u"SCR_????");
if( path.empty() ) {
return;
}
PNGWriter png;
auto create_error = png.create(filename_stem + u".PNG");
auto create_error = png.create(path.replace_extension(u".PNG"));
if( create_error.is_valid() ) {
return;
}