ui: file not up to date display
* the codeview now displays a hatched background for a filename when the file's content has changed or the file does not exist anymore. * added TimePoint class to encapsulate boost.
This commit is contained in:
@@ -94,6 +94,17 @@ std::vector<FileInfo> FileSystem::getFileInfosFromPaths(
|
||||
return files;
|
||||
}
|
||||
|
||||
TimePoint FileSystem::getLastWriteTime(const FilePath& filePath)
|
||||
{
|
||||
boost::posix_time::ptime lastWriteTime;
|
||||
if (FileSystem::exists(filePath.str()))
|
||||
{
|
||||
std::time_t t = boost::filesystem::last_write_time(filePath.path());
|
||||
lastWriteTime = boost::posix_time::from_time_t(t);
|
||||
}
|
||||
return TimePoint(lastWriteTime);
|
||||
}
|
||||
|
||||
std::string FileSystem::getTimeStringNow() // TODO: move to utility
|
||||
{
|
||||
return boost::posix_time::to_iso_string(boost::posix_time::second_clock::universal_time());
|
||||
|
||||
Reference in New Issue
Block a user