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

POSIXFilesystemFactory *POSIXFilesystemFactory::_instance = 0;

POSIXFilesystemFactory *POSIXFilesystemFactory::instance(){
	if(_instance == 0){
		_instance = new POSIXFilesystemFactory();
	}
	return _instance;
}

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);
}