diff options
Diffstat (limited to 'backends/factories/ps2')
-rw-r--r-- | backends/factories/ps2/ps2-fs-factory.cpp | 21 | ||||
-rw-r--r-- | backends/factories/ps2/ps2-fs-factory.h | 28 |
2 files changed, 49 insertions, 0 deletions
diff --git a/backends/factories/ps2/ps2-fs-factory.cpp b/backends/factories/ps2/ps2-fs-factory.cpp new file mode 100644 index 0000000000..cd6f293794 --- /dev/null +++ b/backends/factories/ps2/ps2-fs-factory.cpp @@ -0,0 +1,21 @@ +#include "backends/factories/ps2/ps2-fs-factory.h" +#include "backends/fs/ps2/ps2-fs.cpp" +#include "backends/file/ps2/ps2-file.h" + +DECLARE_SINGLETON(Ps2FilesystemFactory); + +AbstractFilesystemNode *Ps2FilesystemFactory::makeRootFileNode() const { + return new Ps2FilesystemNode(); +} + +AbstractFilesystemNode *Ps2FilesystemFactory::makeCurrentDirectoryFileNode() const { + return new Ps2FilesystemNode(); +} + +AbstractFilesystemNode *Ps2FilesystemFactory::makeFileNodePath(const String &path) const { + return new Ps2FilesystemNode(path); +} + +BaseFile *Ps2FilesystemFactory::makeBaseFile() const { + return new Ps2File(); +} diff --git a/backends/factories/ps2/ps2-fs-factory.h b/backends/factories/ps2/ps2-fs-factory.h new file mode 100644 index 0000000000..e1ddee9677 --- /dev/null +++ b/backends/factories/ps2/ps2-fs-factory.h @@ -0,0 +1,28 @@ +#ifndef PS2_FILESYSTEM_FACTORY_H +#define PS2_FILESYSTEM_FACTORY_H + +#include "common/singleton.h" +#include "backends/factories/abstract-fs-factory.h" + +/** + * Creates PS2FilesystemNode objects. + * + * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. + */ +class Ps2FilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<Ps2FilesystemFactory> { +public: + typedef Common::String String; + + virtual AbstractFilesystemNode *makeRootFileNode() const; + virtual AbstractFilesystemNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const; + virtual BaseFile *makeBaseFile() const; + +protected: + Ps2FilesystemFactory() {}; + +private: + friend class Common::Singleton<SingletonBaseType>; +}; + +#endif /*PS2_FILESYSTEM_FACTORY_H*/ |