summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-04-22 22:08:12 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-04-25 21:27:49 +0100
commitf00999288d860bde0cf99385214a299b87ed691d (patch)
treebf759aa9dd52f93c03e5c94da9f492ac34109b09
parentFileHandle needs a virtual destructor (diff)
downloadgentoobrowse-api-f00999288d860bde0cf99385214a299b87ed691d.tar.bz2
gentoobrowse-api-f00999288d860bde0cf99385214a299b87ed691d.tar.xz
gentoobrowse-api-f00999288d860bde0cf99385214a299b87ed691d.zip
Expose stat data
-rw-r--r--gentoobrowse-api/service/fileUtils.cpp6
-rw-r--r--gentoobrowse-api/service/fileUtils.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/gentoobrowse-api/service/fileUtils.cpp b/gentoobrowse-api/service/fileUtils.cpp
index c9bcc34..1446b9f 100644
--- a/gentoobrowse-api/service/fileUtils.cpp
+++ b/gentoobrowse-api/service/fileUtils.cpp
@@ -35,6 +35,12 @@ namespace Gentoo {
}
}
+ const struct stat &
+ FileHandleStat::getStat() const
+ {
+ return st;
+ }
+
MemMap::MemMap(const boost::filesystem::path & path) :
FileHandleStat(path),
data(mmap(0, st.st_size, PROT_READ, MAP_SHARED, fh, 0))
diff --git a/gentoobrowse-api/service/fileUtils.h b/gentoobrowse-api/service/fileUtils.h
index 51c2875..de6dc79 100644
--- a/gentoobrowse-api/service/fileUtils.h
+++ b/gentoobrowse-api/service/fileUtils.h
@@ -23,6 +23,8 @@ namespace Gentoo {
public:
FileHandleStat(const boost::filesystem::path & path);
+ const struct stat & getStat() const;
+
protected:
struct stat st;
};