summaryrefslogtreecommitdiff
path: root/gentoobrowse-api/service/fileUtils.h
blob: c9a2ec4d6bacf679a459ef8692fba84143e86254 (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
41
42
43
44
#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 {
		namespace File {
			boost::filesystem::path operator/(const boost::filesystem::path & p, unsigned int n);
		}

		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