aboutsummaryrefslogtreecommitdiff
path: root/src/statcache.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2010-01-05 00:17:29 +0000
committerMike Buland <eichlan@xagasoft.com>2010-01-05 00:17:29 +0000
commit6470ee1a051a4e4fac014162c0d9632487093d08 (patch)
treee9924f2dd837ff355223c9daf9a8a7199cf0d88c /src/statcache.cpp
parentcbd66288c6f64a5532c93df29740342edc82075a (diff)
downloadbuild-6470ee1a051a4e4fac014162c0d9632487093d08.tar.gz
build-6470ee1a051a4e4fac014162c0d9632487093d08.tar.bz2
build-6470ee1a051a4e4fac014162c0d9632487093d08.tar.xz
build-6470ee1a051a4e4fac014162c0d9632487093d08.zip
Removed some silly debugging output and added the StatCache, it turns out this
doesn't matter, at least on linux...but...it's a nice idea? I dunno.
Diffstat (limited to 'src/statcache.cpp')
-rw-r--r--src/statcache.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/statcache.cpp b/src/statcache.cpp
new file mode 100644
index 0000000..3f5c21f
--- /dev/null
+++ b/src/statcache.cpp
@@ -0,0 +1,28 @@
1#include "statcache.h"
2
3#include <sys/stat.h>
4
5#include <bu/sio.h>
6
7StatCache::StatCache()
8{
9}
10
11StatCache::~StatCache()
12{
13}
14
15time_t StatCache::mtime( const Bu::FString &sFileName )
16{
17 try
18 {
19 return hMTime.get( sFileName );
20 } catch( ... )
21 {
22 struct stat s;
23 stat( sFileName.getStr(), &s );
24 hMTime.insert( sFileName, s.st_mtime );
25 return s.st_mtime;
26 }
27}
28