From 108ce38443eda81032b72e81202237da53f922e8 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Tue, 1 Dec 2015 18:53:52 +0100 Subject: IOS: Added a chroot like filesystem This is needed because it is not possible to keep absolute paths to the iOS document directory, because a part of its name change between each installation / update. --- backends/fs/chroot/chroot-fs-factory.cpp | 60 +++++++++++++++++ backends/fs/chroot/chroot-fs-factory.h | 41 ++++++++++++ backends/fs/chroot/chroot-fs.cpp | 111 +++++++++++++++++++++++++++++++ backends/fs/chroot/chroot-fs.h | 54 +++++++++++++++ 4 files changed, 266 insertions(+) create mode 100644 backends/fs/chroot/chroot-fs-factory.cpp create mode 100644 backends/fs/chroot/chroot-fs-factory.h create mode 100644 backends/fs/chroot/chroot-fs.cpp create mode 100644 backends/fs/chroot/chroot-fs.h (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs-factory.cpp b/backends/fs/chroot/chroot-fs-factory.cpp new file mode 100644 index 0000000000..4030f4f502 --- /dev/null +++ b/backends/fs/chroot/chroot-fs-factory.cpp @@ -0,0 +1,60 @@ +/* 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. + * + */ + +#if defined(POSIX) + +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h + +#include "chroot-fs-factory.h" +#include "backends/fs/chroot/chroot-fs.h" +#include "backends/fs/posix/posix-fs-factory.h" + +ChRootFilesystemFactory::ChRootFilesystemFactory(Common::String root) { + _root = root; +} + +AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const { + return new ChRootFilesystemNode(_root, "/"); +} + +AbstractFSNode *ChRootFilesystemFactory::makeCurrentDirectoryFileNode() const { + char buf[MAXPATHLEN]; + if (getcwd(buf, MAXPATHLEN) == NULL) { + return NULL; + } + + if (Common::String(buf).hasPrefix(_root + Common::String("/"))) { + return new ChRootFilesystemNode(_root, buf + _root.size()); + } + + return new ChRootFilesystemNode(_root, "/"); +} + +AbstractFSNode *ChRootFilesystemFactory::makeFileNodePath(const Common::String &path) const { + assert(!path.empty()); + return new ChRootFilesystemNode(_root, path); +} + +#endif diff --git a/backends/fs/chroot/chroot-fs-factory.h b/backends/fs/chroot/chroot-fs-factory.h new file mode 100644 index 0000000000..2c05107b0f --- /dev/null +++ b/backends/fs/chroot/chroot-fs-factory.h @@ -0,0 +1,41 @@ +/* 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. + * + */ + +#ifndef CHROOT_FS_FACTORY_H +#define CHROOT_FS_FACTORY_H + +#include "backends/fs/fs-factory.h" + +class ChRootFilesystemFactory : public FilesystemFactory { +private: + Common::String _root; + +protected: + virtual AbstractFSNode *makeRootFileNode() const; + virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const; + +public: + ChRootFilesystemFactory(Common::String root); +}; + +#endif /* CHROOT_FS_FACTORY_H */ diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp new file mode 100644 index 0000000000..1a2bc4c087 --- /dev/null +++ b/backends/fs/chroot/chroot-fs.cpp @@ -0,0 +1,111 @@ +/* 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. + * + */ + +#if defined(POSIX) + +// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h. +// Also with clock() in sys/time.h in some Mac OS X SDKs. +#define FORBIDDEN_SYMBOL_EXCEPTION_time_h +#define FORBIDDEN_SYMBOL_EXCEPTION_unistd_h +#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir +#define FORBIDDEN_SYMBOL_EXCEPTION_getenv +#define FORBIDDEN_SYMBOL_EXCEPTION_exit //Needed for IRIX's unistd.h + +#include "backends/fs/chroot/chroot-fs.h" + +ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *node) { + _root = Common::normalizePath(root, '/'); + _realNode = node; +} + +ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) { + _root = Common::normalizePath(root, '/'); + _realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path)); +} + +ChRootFilesystemNode::~ChRootFilesystemNode() { + delete _realNode; +} + +bool ChRootFilesystemNode::exists() const { + return _realNode->exists(); +} + +Common::String ChRootFilesystemNode::getDisplayName() const { + return getName(); +} + +Common::String ChRootFilesystemNode::getName() const { + return _realNode->AbstractFSNode::getDisplayName(); +} + +Common::String ChRootFilesystemNode::getPath() const { + Common::String path = _realNode->getPath(); + if (path.size() > _root.size()) { + return Common::String(path.c_str() + _root.size()); + } + return Common::String("/"); +} + +bool ChRootFilesystemNode::isDirectory() const { + return _realNode->isDirectory(); +} + +bool ChRootFilesystemNode::isReadable() const { + return _realNode->isReadable(); +} + +bool ChRootFilesystemNode::isWritable() const { + return _realNode->isWritable(); +} + +AbstractFSNode *ChRootFilesystemNode::getChild(const Common::String &n) const { + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getChild(n)); +} + +bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { + AbstractFSList tmp; + if (!_realNode->getChildren(tmp, mode, hidden)) { + return false; + } + + for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) { + list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i)); + } + + return true; +} + +AbstractFSNode *ChRootFilesystemNode::getParent() const { + if (getPath() == "/") return 0; + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent()); +} + +Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() { + return _realNode->createReadStream(); +} + +Common::WriteStream *ChRootFilesystemNode::createWriteStream() { + return _realNode->createWriteStream(); +} + +#endif diff --git a/backends/fs/chroot/chroot-fs.h b/backends/fs/chroot/chroot-fs.h new file mode 100644 index 0000000000..7dd62cb9a8 --- /dev/null +++ b/backends/fs/chroot/chroot-fs.h @@ -0,0 +1,54 @@ +/* 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. + * + */ + +#ifndef CHROOT_FS_H +#define CHROOT_FS_H + +#include "backends/fs/posix/posix-fs.h" + +class ChRootFilesystemNode : public AbstractFSNode { + Common::String _root; + POSIXFilesystemNode *_realNode; + + ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *); + +public: + ChRootFilesystemNode(const Common::String &root, const Common::String &path); + virtual ~ChRootFilesystemNode(); + + virtual bool exists() const; + virtual Common::String getDisplayName() const; + virtual Common::String getName() const; + virtual Common::String getPath() const; + virtual bool isDirectory() const; + virtual bool isReadable() const; + virtual bool isWritable() const; + + virtual AbstractFSNode *getChild(const Common::String &n) const; + virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; + virtual AbstractFSNode *getParent() const; + + virtual Common::SeekableReadStream *createReadStream(); + virtual Common::WriteStream *createWriteStream(); +}; + +#endif /* CHROOT_FS_H */ -- cgit v1.2.3 From c1e664b6d681e4f59de361457e7487c138aaf31f Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Thu, 3 Dec 2015 07:13:15 +0100 Subject: IOS: Replaces spaces with tabs --- backends/fs/chroot/chroot-fs-factory.cpp | 24 ++++++------- backends/fs/chroot/chroot-fs-factory.h | 10 +++--- backends/fs/chroot/chroot-fs.cpp | 58 ++++++++++++++++---------------- backends/fs/chroot/chroot-fs.h | 40 +++++++++++----------- 4 files changed, 66 insertions(+), 66 deletions(-) (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs-factory.cpp b/backends/fs/chroot/chroot-fs-factory.cpp index 4030f4f502..fa98ab75d3 100644 --- a/backends/fs/chroot/chroot-fs-factory.cpp +++ b/backends/fs/chroot/chroot-fs-factory.cpp @@ -32,29 +32,29 @@ #include "backends/fs/posix/posix-fs-factory.h" ChRootFilesystemFactory::ChRootFilesystemFactory(Common::String root) { - _root = root; + _root = root; } AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const { - return new ChRootFilesystemNode(_root, "/"); + return new ChRootFilesystemNode(_root, "/"); } AbstractFSNode *ChRootFilesystemFactory::makeCurrentDirectoryFileNode() const { - char buf[MAXPATHLEN]; - if (getcwd(buf, MAXPATHLEN) == NULL) { - return NULL; - } + char buf[MAXPATHLEN]; + if (getcwd(buf, MAXPATHLEN) == NULL) { + return NULL; + } - if (Common::String(buf).hasPrefix(_root + Common::String("/"))) { - return new ChRootFilesystemNode(_root, buf + _root.size()); - } + if (Common::String(buf).hasPrefix(_root + Common::String("/"))) { + return new ChRootFilesystemNode(_root, buf + _root.size()); + } - return new ChRootFilesystemNode(_root, "/"); + return new ChRootFilesystemNode(_root, "/"); } AbstractFSNode *ChRootFilesystemFactory::makeFileNodePath(const Common::String &path) const { - assert(!path.empty()); - return new ChRootFilesystemNode(_root, path); + assert(!path.empty()); + return new ChRootFilesystemNode(_root, path); } #endif diff --git a/backends/fs/chroot/chroot-fs-factory.h b/backends/fs/chroot/chroot-fs-factory.h index 2c05107b0f..c7bd9a74a7 100644 --- a/backends/fs/chroot/chroot-fs-factory.h +++ b/backends/fs/chroot/chroot-fs-factory.h @@ -27,15 +27,15 @@ class ChRootFilesystemFactory : public FilesystemFactory { private: - Common::String _root; + Common::String _root; protected: - virtual AbstractFSNode *makeRootFileNode() const; - virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; - virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const; + virtual AbstractFSNode *makeRootFileNode() const; + virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; + virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const; public: - ChRootFilesystemFactory(Common::String root); + ChRootFilesystemFactory(Common::String root); }; #endif /* CHROOT_FS_FACTORY_H */ diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp index 1a2bc4c087..7cdd800dac 100644 --- a/backends/fs/chroot/chroot-fs.cpp +++ b/backends/fs/chroot/chroot-fs.cpp @@ -33,79 +33,79 @@ #include "backends/fs/chroot/chroot-fs.h" ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *node) { - _root = Common::normalizePath(root, '/'); - _realNode = node; + _root = Common::normalizePath(root, '/'); + _realNode = node; } ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) { - _root = Common::normalizePath(root, '/'); - _realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path)); + _root = Common::normalizePath(root, '/'); + _realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path)); } ChRootFilesystemNode::~ChRootFilesystemNode() { - delete _realNode; + delete _realNode; } bool ChRootFilesystemNode::exists() const { - return _realNode->exists(); + return _realNode->exists(); } Common::String ChRootFilesystemNode::getDisplayName() const { - return getName(); + return getName(); } Common::String ChRootFilesystemNode::getName() const { - return _realNode->AbstractFSNode::getDisplayName(); + return _realNode->AbstractFSNode::getDisplayName(); } Common::String ChRootFilesystemNode::getPath() const { - Common::String path = _realNode->getPath(); - if (path.size() > _root.size()) { - return Common::String(path.c_str() + _root.size()); - } - return Common::String("/"); + Common::String path = _realNode->getPath(); + if (path.size() > _root.size()) { + return Common::String(path.c_str() + _root.size()); + } + return Common::String("/"); } bool ChRootFilesystemNode::isDirectory() const { - return _realNode->isDirectory(); + return _realNode->isDirectory(); } bool ChRootFilesystemNode::isReadable() const { - return _realNode->isReadable(); + return _realNode->isReadable(); } bool ChRootFilesystemNode::isWritable() const { - return _realNode->isWritable(); + return _realNode->isWritable(); } AbstractFSNode *ChRootFilesystemNode::getChild(const Common::String &n) const { - return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getChild(n)); + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getChild(n)); } bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { - AbstractFSList tmp; - if (!_realNode->getChildren(tmp, mode, hidden)) { - return false; - } + AbstractFSList tmp; + if (!_realNode->getChildren(tmp, mode, hidden)) { + return false; + } - for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) { - list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i)); - } + for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) { + list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i)); + } - return true; + return true; } AbstractFSNode *ChRootFilesystemNode::getParent() const { - if (getPath() == "/") return 0; - return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent()); + if (getPath() == "/") return 0; + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent()); } Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() { - return _realNode->createReadStream(); + return _realNode->createReadStream(); } Common::WriteStream *ChRootFilesystemNode::createWriteStream() { - return _realNode->createWriteStream(); + return _realNode->createWriteStream(); } #endif diff --git a/backends/fs/chroot/chroot-fs.h b/backends/fs/chroot/chroot-fs.h index 7dd62cb9a8..2d4c3eb9dd 100644 --- a/backends/fs/chroot/chroot-fs.h +++ b/backends/fs/chroot/chroot-fs.h @@ -26,29 +26,29 @@ #include "backends/fs/posix/posix-fs.h" class ChRootFilesystemNode : public AbstractFSNode { - Common::String _root; - POSIXFilesystemNode *_realNode; + Common::String _root; + POSIXFilesystemNode *_realNode; - ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *); + ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *); public: - ChRootFilesystemNode(const Common::String &root, const Common::String &path); - virtual ~ChRootFilesystemNode(); - - virtual bool exists() const; - virtual Common::String getDisplayName() const; - virtual Common::String getName() const; - virtual Common::String getPath() const; - virtual bool isDirectory() const; - virtual bool isReadable() const; - virtual bool isWritable() const; - - virtual AbstractFSNode *getChild(const Common::String &n) const; - virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; - virtual AbstractFSNode *getParent() const; - - virtual Common::SeekableReadStream *createReadStream(); - virtual Common::WriteStream *createWriteStream(); + ChRootFilesystemNode(const Common::String &root, const Common::String &path); + virtual ~ChRootFilesystemNode(); + + virtual bool exists() const; + virtual Common::String getDisplayName() const; + virtual Common::String getName() const; + virtual Common::String getPath() const; + virtual bool isDirectory() const; + virtual bool isReadable() const; + virtual bool isWritable() const; + + virtual AbstractFSNode *getChild(const Common::String &n) const; + virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; + virtual AbstractFSNode *getParent() const; + + virtual Common::SeekableReadStream *createReadStream(); + virtual Common::WriteStream *createWriteStream(); }; #endif /* CHROOT_FS_H */ -- cgit v1.2.3 From 793acc0f2db88078bc4c54c95156c75b3dfbda5e Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 10:19:49 +0100 Subject: IOS: Adds a warning regarding the usage of the ChRootFS class --- backends/fs/chroot/chroot-fs-factory.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs-factory.h b/backends/fs/chroot/chroot-fs-factory.h index c7bd9a74a7..23b3c8f44a 100644 --- a/backends/fs/chroot/chroot-fs-factory.h +++ b/backends/fs/chroot/chroot-fs-factory.h @@ -20,8 +20,12 @@ * */ -#ifndef CHROOT_FS_FACTORY_H -#define CHROOT_FS_FACTORY_H +/* + * FIXME: Warning, using this factory in your backend may silently breaks some features. Instances are, for example, the FluidSynth code, and the POSIX plugin code. + */ + +#ifndef BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H +#define BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H #include "backends/fs/fs-factory.h" @@ -38,4 +42,4 @@ public: ChRootFilesystemFactory(Common::String root); }; -#endif /* CHROOT_FS_FACTORY_H */ +#endif /* BACKENDS_FS_CHROOT_CHROOT_FS_FACTORY_H */ -- cgit v1.2.3 From 16605a3e1062efe96d1f647a93ddda379c77f453 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 15:43:42 +0100 Subject: IOS: Moves the helper function were it is used. --- backends/fs/chroot/chroot-fs.cpp | 15 ++++++++++++++- backends/fs/chroot/chroot-fs.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp index 7cdd800dac..1c3e3b545f 100644 --- a/backends/fs/chroot/chroot-fs.cpp +++ b/backends/fs/chroot/chroot-fs.cpp @@ -39,7 +39,7 @@ ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFile ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) { _root = Common::normalizePath(root, '/'); - _realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path)); + _realNode = new POSIXFilesystemNode(addPathComponent(root, path)); } ChRootFilesystemNode::~ChRootFilesystemNode() { @@ -108,4 +108,17 @@ Common::WriteStream *ChRootFilesystemNode::createWriteStream() { return _realNode->createWriteStream(); } +Common::String ChRootFilesystemNode::addPathComponent(const Common::String &path, const Common::String &component) { + const char sep = '/'; + if (path.lastChar() == sep && component.firstChar() == sep) { + return Common::String::format("%s%s", path.c_str(), component.c_str() + 1); + } + + if (path.lastChar() == sep || component.firstChar() == sep) { + return Common::String::format("%s%s", path.c_str(), component.c_str()); + } + + return Common::String::format("%s%c%s", path.c_str(), sep, component.c_str()); +} + #endif diff --git a/backends/fs/chroot/chroot-fs.h b/backends/fs/chroot/chroot-fs.h index 2d4c3eb9dd..c330123bb5 100644 --- a/backends/fs/chroot/chroot-fs.h +++ b/backends/fs/chroot/chroot-fs.h @@ -49,6 +49,9 @@ public: virtual Common::SeekableReadStream *createReadStream(); virtual Common::WriteStream *createWriteStream(); + +private: + static Common::String addPathComponent(const Common::String &path, const Common::String &component); }; #endif /* CHROOT_FS_H */ -- cgit v1.2.3 From 1c515e90e27fb346532270201cc413b106b7137c Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 10:36:25 +0100 Subject: IOS: Formatting --- backends/fs/chroot/chroot-fs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs.cpp b/backends/fs/chroot/chroot-fs.cpp index 1c3e3b545f..2cbb4af9d6 100644 --- a/backends/fs/chroot/chroot-fs.cpp +++ b/backends/fs/chroot/chroot-fs.cpp @@ -79,7 +79,7 @@ bool ChRootFilesystemNode::isWritable() const { } AbstractFSNode *ChRootFilesystemNode::getChild(const Common::String &n) const { - return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getChild(n)); + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *)_realNode->getChild(n)); } bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const { @@ -97,7 +97,7 @@ bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool AbstractFSNode *ChRootFilesystemNode::getParent() const { if (getPath() == "/") return 0; - return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent()); + return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *)_realNode->getParent()); } Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() { -- cgit v1.2.3 From 89002d5cf6f8bda6b64efd9d47d9275c2665af56 Mon Sep 17 00:00:00 2001 From: Vincent Bénony Date: Wed, 6 Jan 2016 10:55:23 +0100 Subject: IOS: Formatting --- backends/fs/chroot/chroot-fs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/fs/chroot') diff --git a/backends/fs/chroot/chroot-fs.h b/backends/fs/chroot/chroot-fs.h index c330123bb5..9ff913be31 100644 --- a/backends/fs/chroot/chroot-fs.h +++ b/backends/fs/chroot/chroot-fs.h @@ -20,8 +20,8 @@ * */ -#ifndef CHROOT_FS_H -#define CHROOT_FS_H +#ifndef BACKENDS_FS_CHROOT_CHROOT_FS_H +#define BACKENDS_FS_CHROOT_CHROOT_FS_H #include "backends/fs/posix/posix-fs.h" @@ -54,4 +54,4 @@ private: static Common::String addPathComponent(const Common::String &path, const Common::String &component); }; -#endif /* CHROOT_FS_H */ +#endif /* BACKENDS_FS_CHROOT_CHROOT_FS_H */ -- cgit v1.2.3