aboutsummaryrefslogtreecommitdiff
path: root/backends/factories/posix/posix-fs-factory.cpp
blob: 9b77e3155728ceda3d4626c1fcbfbc10296c3477 (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
#include "backends/factories/posix/posix-fs-factory.h"
#include "backends/fs/posix/posix-fs.cpp"
#include "backends/file/posix/posix-file.cpp"
//#include "backends/file/base-file.cpp"

DECLARE_SINGLETON(POSIXFilesystemFactory);

AbstractFilesystemNode *POSIXFilesystemFactory::makeRootFileNode() const {
	return new POSIXFilesystemNode();
}

AbstractFilesystemNode *POSIXFilesystemFactory::makeCurrentDirectoryFileNode() const {
	char buf[MAXPATHLEN];
	getcwd(buf, MAXPATHLEN);
	return new POSIXFilesystemNode(buf, true);
}

AbstractFilesystemNode *POSIXFilesystemFactory::makeFileNodePath(const String &path) const {
	return new POSIXFilesystemNode(path, true);
}

BaseFile *POSIXFilesystemFactory::makeBaseFile() const {
	return new POSIXFile();
}