summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/service/fileUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'gentoobrowse-api/service/fileUtils.h')
-rw-r--r--gentoobrowse-api/service/fileUtils.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/gentoobrowse-api/service/fileUtils.h b/gentoobrowse-api/service/fileUtils.h
new file mode 100644
index 0000000..58d235f
--- /dev/null
+++ b/gentoobrowse-api/service/fileUtils.h
@@ -0,0 +1,40 @@
+#ifndef GENTOOBROWSE_API_SERVICE_FILEUTILS_H
+#define GENTOOBROWSE_API_SERVICE_FILEUTILS_H
+
+#include <boost/filesystem/path.hpp>
+#include <sys/stat.h>
+
+namespace Gentoo {
+ namespace Utils {
+ class FileHandle {
+ public:
+ FileHandle(const std::string & path);
+ ~FileHandle();
+
+ protected:
+ const int fh;
+ };
+
+ class FileHandleStat : public FileHandle {
+ public:
+ FileHandleStat(const std::string & path);
+
+ protected:
+ struct stat st;
+ };
+
+ class MemMap : public FileHandleStat {
+ public:
+ MemMap(const std::string & path);
+ ~MemMap();
+
+ protected:
+ void * data;
+ };
+
+ }
+}
+
+#endif
+
+