2007-08-18 05:24:18 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2007-09-18 20:02:04 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2007-08-18 05:24:18 +00:00
|
|
|
*/
|
|
|
|
|
2008-02-23 19:01:12 +00:00
|
|
|
#ifndef FILESYSTEM_FACTORY_H
|
|
|
|
#define FILESYSTEM_FACTORY_H
|
2007-05-03 02:39:33 +00:00
|
|
|
|
|
|
|
#include "common/str.h"
|
2007-08-01 22:07:50 +00:00
|
|
|
#include "backends/fs/abstract-fs.h"
|
2007-05-03 02:39:33 +00:00
|
|
|
|
|
|
|
/**
|
2008-10-02 16:58:59 +00:00
|
|
|
* Creates concrete FSNode objects depending on the current architecture.
|
2007-05-03 02:39:33 +00:00
|
|
|
*/
|
2008-02-23 19:01:12 +00:00
|
|
|
class FilesystemFactory {
|
2007-05-03 02:39:33 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Destructor.
|
|
|
|
*/
|
2008-02-23 19:01:12 +00:00
|
|
|
virtual ~FilesystemFactory() {}
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2007-05-03 02:39:33 +00:00
|
|
|
/**
|
|
|
|
* Returns a node representing the "current directory".
|
|
|
|
* If your system does not support this concept, you can either try to
|
|
|
|
* emulate it or simply return some "sensible" default directory node,
|
|
|
|
* e.g. the same value as getRoot() returns.
|
|
|
|
*/
|
2008-10-02 16:58:59 +00:00
|
|
|
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const = 0;
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2007-05-03 02:39:33 +00:00
|
|
|
/**
|
|
|
|
* Construct a node based on a path; the path is in the same format as it
|
|
|
|
* would be for calls to fopen().
|
|
|
|
*
|
|
|
|
* Furthermore getNodeForPath(oldNode.path()) should create a new node
|
|
|
|
* identical to oldNode. Hence, we can use the "path" value for persistent
|
|
|
|
* storage e.g. in the config file.
|
|
|
|
*
|
2008-10-02 16:58:59 +00:00
|
|
|
* @param path The path string to create a FSNode for.
|
2007-05-03 02:39:33 +00:00
|
|
|
*/
|
2008-10-02 16:58:59 +00:00
|
|
|
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const = 0;
|
2007-09-19 08:40:12 +00:00
|
|
|
|
2007-05-03 02:39:33 +00:00
|
|
|
/**
|
|
|
|
* Returns a special node representing the filesystem root.
|
|
|
|
* The starting point for any file system browsing.
|
2007-09-19 08:40:12 +00:00
|
|
|
*
|
2007-05-03 02:39:33 +00:00
|
|
|
* On Unix, this will be simply the node for / (the root directory).
|
|
|
|
* On Windows, it will be a special node which "contains" all drives (C:, D:, E:).
|
|
|
|
*/
|
2008-10-02 16:58:59 +00:00
|
|
|
virtual AbstractFSNode *makeRootFileNode() const = 0;
|
2007-05-03 02:39:33 +00:00
|
|
|
};
|
|
|
|
|
2008-02-23 19:01:12 +00:00
|
|
|
#endif /*FILESYSTEM_FACTORY_H*/
|