From 86324f00bc561c03b281170125ef2fde14cae132 Mon Sep 17 00:00:00 2001 From: David Corrales Date: Sat, 12 May 2007 18:17:40 +0000 Subject: Renamed files and minor tweaks. Thanks LordHoto :) svn-id: r26810 --- backends/fs/posix/posix-fs-factory.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 backends/fs/posix/posix-fs-factory.cpp (limited to 'backends/fs/posix/posix-fs-factory.cpp') diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp new file mode 100644 index 0000000000..b302bb31e8 --- /dev/null +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -0,0 +1,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); +} -- cgit v1.2.3 From d1f56d93f934150f4b579c2e90564e2bf035f113 Mon Sep 17 00:00:00 2001 From: David Corrales Date: Sat, 12 May 2007 20:00:52 +0000 Subject: Use common/singleton.h in the concrete fs factories. svn-id: r26814 --- backends/fs/posix/posix-fs-factory.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'backends/fs/posix/posix-fs-factory.cpp') diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp index b302bb31e8..bed3dc5f8f 100644 --- a/backends/fs/posix/posix-fs-factory.cpp +++ b/backends/fs/posix/posix-fs-factory.cpp @@ -1,14 +1,7 @@ #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; -} +DECLARE_SINGLETON(POSIXFilesystemFactory); AbstractFilesystemNode *POSIXFilesystemFactory::makeRootFileNode() const { return new POSIXFilesystemNode(); -- cgit v1.2.3 From 1400d28bfb37fc94f3c44dec0a4d0cef65fb8fb7 Mon Sep 17 00:00:00 2001 From: David Corrales Date: Wed, 1 Aug 2007 22:07:50 +0000 Subject: Initial commit of the new BaseFile implementation. It provides a common ground for file objects across platforms and divides responsibilities between the Common::File class and a base file implementation. Also rearranged the factories into a new directory for clarity. Note 1: The posix-file.h and cpp files are for testing only. Only the ds, ps2 and symbian architecture will use special BaseFile based objects. Note 2: The current code does not yet make use of this new structure, since the Common::File remains intact. svn-id: r28395 --- backends/fs/posix/posix-fs-factory.cpp | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 backends/fs/posix/posix-fs-factory.cpp (limited to 'backends/fs/posix/posix-fs-factory.cpp') diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp deleted file mode 100644 index bed3dc5f8f..0000000000 --- a/backends/fs/posix/posix-fs-factory.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "backends/fs/posix/posix-fs-factory.h" -#include "backends/fs/posix/posix-fs.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); -} -- cgit v1.2.3