aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/ds/ds-fs-factory.cpp
blob: 7e64b37411599ca5e4f8a59d86d21658de8a99bb (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
#include "backends/fs/ds/ds-fs-factory.h"
#include "backends/fs/ds/ds-fs.cpp"
#include "dsmain.h" //for the isGBAMPAvailable() function

DECLARE_SINGLETON(DSFilesystemFactory);

AbstractFilesystemNode *DSFilesystemFactory::makeRootFileNode() const {
	if (DS::isGBAMPAvailable()) {
		return new DS::GBAMPFileSystemNode();
	} else {
		return new DS::DSFileSystemNode();
	}
}

AbstractFilesystemNode *DSFilesystemFactory::makeCurrentDirectoryFileNode() const {
	if (DS::isGBAMPAvailable()) {
		return new DS::GBAMPFileSystemNode();
	} else {
		return new DS::DSFileSystemNode();
	}
}

AbstractFilesystemNode *DSFilesystemFactory::makeFileNodePath(const String &path) const {
	if (DS::isGBAMPAvailable()) {
		return new DS::GBAMPFileSystemNode(path);
	} else {
		return new DS::DSFileSystemNode(path);
	}
}