diff options
Diffstat (limited to 'backends/factories/dc')
-rw-r--r-- | backends/factories/dc/ronincd-fs-factory.cpp | 21 | ||||
-rw-r--r-- | backends/factories/dc/ronincd-fs-factory.h | 28 |
2 files changed, 49 insertions, 0 deletions
diff --git a/backends/factories/dc/ronincd-fs-factory.cpp b/backends/factories/dc/ronincd-fs-factory.cpp new file mode 100644 index 0000000000..c28d735aec --- /dev/null +++ b/backends/factories/dc/ronincd-fs-factory.cpp @@ -0,0 +1,21 @@ +#include "backends/factories/dc/ronincd-fs-factory.h" +#include "backends/fs/dc/dc-fs.cpp" +#include "backends/file/base-file.h" + +DECLARE_SINGLETON(RoninCDFilesystemFactory); + +AbstractFilesystemNode *RoninCDFilesystemFactory::makeRootFileNode() const { + return new RoninCDFilesystemNode(); +} + +AbstractFilesystemNode *RoninCDFilesystemFactory::makeCurrentDirectoryFileNode() const { + return new RoninCDFilesystemNode(); +} + +AbstractFilesystemNode *RoninCDFilesystemFactory::makeFileNodePath(const String &path) const { + return new RoninCDFilesystemNode(path, true); +} + +BaseFile *RoninCDFilesystemFactory::makeBaseFile() const { + return new BaseFile(); +} diff --git a/backends/factories/dc/ronincd-fs-factory.h b/backends/factories/dc/ronincd-fs-factory.h new file mode 100644 index 0000000000..5aa6f7a91f --- /dev/null +++ b/backends/factories/dc/ronincd-fs-factory.h @@ -0,0 +1,28 @@ +#ifndef RONINCD_FILESYSTEM_FACTORY_H +#define RONINCD_FILESYSTEM_FACTORY_H + +#include "common/singleton.h" +#include "backends/factories/abstract-fs-factory.h" + +/** + * Creates RoninCDFilesystemNode objects. + * + * Parts of this class are documented in the base interface class, AbstractFilesystemFactory. + */ +class RoninCDFilesystemFactory : public AbstractFilesystemFactory, public Common::Singleton<RoninCDFilesystemFactory> { +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: + RoninCDFilesystemFactory() {}; + +private: + friend class Common::Singleton<SingletonBaseType>; +}; + +#endif /*RONINCD_FILESYSTEM_FACTORY_H*/ |