summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/service/fileUtils.h
blob: 58d235f4a37cbdb46ef46e9200fba388be5d6750 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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