From f00999288d860bde0cf99385214a299b87ed691d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 22 Apr 2016 22:08:12 +0100 Subject: Expose stat data --- gentoobrowse-api/service/fileUtils.cpp | 6 ++++++ gentoobrowse-api/service/fileUtils.h | 2 ++ 2 files changed, 8 insertions(+) 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; }; -- cgit v1.2.3