From 9fa0576e38559ebe7ff63a8d1161123b049a933b Mon Sep 17 00:00:00 2001 From: Sascha Volkenandt Date: Thu, 31 May 2007 16:23:54 +0000 Subject: - some optimisations - added dropping items out of cache --- filecache.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'filecache.cpp') diff --git a/filecache.cpp b/filecache.cpp index 9a21647..37a1e85 100644 --- a/filecache.cpp +++ b/filecache.cpp @@ -10,22 +10,10 @@ std::time_t FileObject::get_filetime( std::string const& path ) { struct stat sbuf; if ( stat( path.c_str(), &sbuf ) < 0 ) - return 0; // XXX + return 0; return sbuf.st_ctime; } -bool FileObject::is_current() const -{ - return m_ctime < get_filetime( m_path ); - /*struct stat statBuf = { 0 }; - * if ( ::stat( m_path.c_str(), &statBuf ) < 0 ) { - * } - if ( m_ctime == 0 ) - return true; - m_ctime = get_filetime( m_path ); - return timestamp < m_ctime;*/ -} - bool FileObject::load() { std::ifstream ifs( m_path.c_str(), std::ios::in | std::ios::binary | std::ios::ate ); -- cgit v1.2.3