src/App.cpp
// load the "recent files" file that osc persists to disk
load the "recent files" file that osc persists to disk
load the " recent files " file that osc persists to disk
static std::vector<RecentFile> LoadRecentFilesFile(std::filesystem::path const& p)
{
    std::ifstream fd{p, std::ios::in};
    if (!fd)
    {
        osc::log::error("%s: could not be opened for reading: cannot load recent files list", p.string().c_str());
        return {};
    }
    std::vector<RecentFile> rv;
    std::string line;
    while (std::getline(fd, line))
    {
        std::istringstream ss{line};
        uint64_t timestamp;
        std::filesystem::path path;
        ss >> timestamp;
        ss >> path;
        bool exists = std::filesystem::exists(path);
        std::chrono::seconds timestampSecs{timestamp};
        rv.push_back(RecentFile{exists, std::move(timestampSecs), std::move(path)});
    }
    return rv;
}
static std :: vector < RecentFile > LoadRecentFilesFile ( std :: filesystem :: path const & p ) { std :: ifstream fd { p , std :: ios :: in } ; if ( ! fd ) { osc :: log :: error ( " " , p . string ( ) . c_str ( ) ) ; return { } ; } std :: vector < RecentFile > rv ; std :: string line ; while ( std :: getline ( fd , line ) ) { std :: istringstream ss { line } ; uint64_t timestamp ; std :: filesystem :: path path ; ss >> timestamp ; ss >> path ; bool exists = std :: filesystem :: exists ( path ) ; std :: chrono :: seconds timestampSecs { timestamp } ; rv . push_back ( RecentFile { exists , std :: move ( timestampSecs ) , std :: move ( path ) } ) ; } return rv ; }
load the "recent files" file that osc persists to disk
load the " recent files " file that osc persists to disk
// do not throw, because it probably shouldn't crash the application if this // is an issue // read line content // calc tertiary data