IOS: Replaces spaces with tabs

This commit is contained in:
Vincent Bénony 2015-12-03 07:13:15 +01:00
parent 106e3a87bd
commit c1e664b6d6
7 changed files with 67 additions and 67 deletions

View file

@ -32,29 +32,29 @@
#include "backends/fs/posix/posix-fs-factory.h" #include "backends/fs/posix/posix-fs-factory.h"
ChRootFilesystemFactory::ChRootFilesystemFactory(Common::String root) { ChRootFilesystemFactory::ChRootFilesystemFactory(Common::String root) {
_root = root; _root = root;
} }
AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const { AbstractFSNode *ChRootFilesystemFactory::makeRootFileNode() const {
return new ChRootFilesystemNode(_root, "/"); return new ChRootFilesystemNode(_root, "/");
} }
AbstractFSNode *ChRootFilesystemFactory::makeCurrentDirectoryFileNode() const { AbstractFSNode *ChRootFilesystemFactory::makeCurrentDirectoryFileNode() const {
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
if (getcwd(buf, MAXPATHLEN) == NULL) { if (getcwd(buf, MAXPATHLEN) == NULL) {
return NULL; return NULL;
} }
if (Common::String(buf).hasPrefix(_root + Common::String("/"))) { if (Common::String(buf).hasPrefix(_root + Common::String("/"))) {
return new ChRootFilesystemNode(_root, buf + _root.size()); return new ChRootFilesystemNode(_root, buf + _root.size());
} }
return new ChRootFilesystemNode(_root, "/"); return new ChRootFilesystemNode(_root, "/");
} }
AbstractFSNode *ChRootFilesystemFactory::makeFileNodePath(const Common::String &path) const { AbstractFSNode *ChRootFilesystemFactory::makeFileNodePath(const Common::String &path) const {
assert(!path.empty()); assert(!path.empty());
return new ChRootFilesystemNode(_root, path); return new ChRootFilesystemNode(_root, path);
} }
#endif #endif

View file

@ -27,15 +27,15 @@
class ChRootFilesystemFactory : public FilesystemFactory { class ChRootFilesystemFactory : public FilesystemFactory {
private: private:
Common::String _root; Common::String _root;
protected: protected:
virtual AbstractFSNode *makeRootFileNode() const; virtual AbstractFSNode *makeRootFileNode() const;
virtual AbstractFSNode *makeCurrentDirectoryFileNode() const; virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const; virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
public: public:
ChRootFilesystemFactory(Common::String root); ChRootFilesystemFactory(Common::String root);
}; };
#endif /* CHROOT_FS_FACTORY_H */ #endif /* CHROOT_FS_FACTORY_H */

View file

@ -33,79 +33,79 @@
#include "backends/fs/chroot/chroot-fs.h" #include "backends/fs/chroot/chroot-fs.h"
ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *node) { ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *node) {
_root = Common::normalizePath(root, '/'); _root = Common::normalizePath(root, '/');
_realNode = node; _realNode = node;
} }
ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) { ChRootFilesystemNode::ChRootFilesystemNode(const Common::String &root, const Common::String &path) {
_root = Common::normalizePath(root, '/'); _root = Common::normalizePath(root, '/');
_realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path)); _realNode = new POSIXFilesystemNode(root.stringByAppendingPathComponent(path));
} }
ChRootFilesystemNode::~ChRootFilesystemNode() { ChRootFilesystemNode::~ChRootFilesystemNode() {
delete _realNode; delete _realNode;
} }
bool ChRootFilesystemNode::exists() const { bool ChRootFilesystemNode::exists() const {
return _realNode->exists(); return _realNode->exists();
} }
Common::String ChRootFilesystemNode::getDisplayName() const { Common::String ChRootFilesystemNode::getDisplayName() const {
return getName(); return getName();
} }
Common::String ChRootFilesystemNode::getName() const { Common::String ChRootFilesystemNode::getName() const {
return _realNode->AbstractFSNode::getDisplayName(); return _realNode->AbstractFSNode::getDisplayName();
} }
Common::String ChRootFilesystemNode::getPath() const { Common::String ChRootFilesystemNode::getPath() const {
Common::String path = _realNode->getPath(); Common::String path = _realNode->getPath();
if (path.size() > _root.size()) { if (path.size() > _root.size()) {
return Common::String(path.c_str() + _root.size()); return Common::String(path.c_str() + _root.size());
} }
return Common::String("/"); return Common::String("/");
} }
bool ChRootFilesystemNode::isDirectory() const { bool ChRootFilesystemNode::isDirectory() const {
return _realNode->isDirectory(); return _realNode->isDirectory();
} }
bool ChRootFilesystemNode::isReadable() const { bool ChRootFilesystemNode::isReadable() const {
return _realNode->isReadable(); return _realNode->isReadable();
} }
bool ChRootFilesystemNode::isWritable() const { bool ChRootFilesystemNode::isWritable() const {
return _realNode->isWritable(); return _realNode->isWritable();
} }
AbstractFSNode *ChRootFilesystemNode::getChild(const Common::String &n) 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 { bool ChRootFilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hidden) const {
AbstractFSList tmp; AbstractFSList tmp;
if (!_realNode->getChildren(tmp, mode, hidden)) { if (!_realNode->getChildren(tmp, mode, hidden)) {
return false; return false;
} }
for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) { for (AbstractFSList::iterator i=tmp.begin(); i!=tmp.end(); ++i) {
list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i)); list.push_back(new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) *i));
} }
return true; return true;
} }
AbstractFSNode *ChRootFilesystemNode::getParent() const { AbstractFSNode *ChRootFilesystemNode::getParent() const {
if (getPath() == "/") return 0; if (getPath() == "/") return 0;
return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent()); return new ChRootFilesystemNode(_root, (POSIXFilesystemNode *) _realNode->getParent());
} }
Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() { Common::SeekableReadStream *ChRootFilesystemNode::createReadStream() {
return _realNode->createReadStream(); return _realNode->createReadStream();
} }
Common::WriteStream *ChRootFilesystemNode::createWriteStream() { Common::WriteStream *ChRootFilesystemNode::createWriteStream() {
return _realNode->createWriteStream(); return _realNode->createWriteStream();
} }
#endif #endif

View file

@ -26,29 +26,29 @@
#include "backends/fs/posix/posix-fs.h" #include "backends/fs/posix/posix-fs.h"
class ChRootFilesystemNode : public AbstractFSNode { class ChRootFilesystemNode : public AbstractFSNode {
Common::String _root; Common::String _root;
POSIXFilesystemNode *_realNode; POSIXFilesystemNode *_realNode;
ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *); ChRootFilesystemNode(const Common::String &root, POSIXFilesystemNode *);
public: public:
ChRootFilesystemNode(const Common::String &root, const Common::String &path); ChRootFilesystemNode(const Common::String &root, const Common::String &path);
virtual ~ChRootFilesystemNode(); virtual ~ChRootFilesystemNode();
virtual bool exists() const; virtual bool exists() const;
virtual Common::String getDisplayName() const; virtual Common::String getDisplayName() const;
virtual Common::String getName() const; virtual Common::String getName() const;
virtual Common::String getPath() const; virtual Common::String getPath() const;
virtual bool isDirectory() const; virtual bool isDirectory() const;
virtual bool isReadable() const; virtual bool isReadable() const;
virtual bool isWritable() const; virtual bool isWritable() const;
virtual AbstractFSNode *getChild(const Common::String &n) const; virtual AbstractFSNode *getChild(const Common::String &n) const;
virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const; virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
virtual AbstractFSNode *getParent() const; virtual AbstractFSNode *getParent() const;
virtual Common::SeekableReadStream *createReadStream(); virtual Common::SeekableReadStream *createReadStream();
virtual Common::WriteStream *createWriteStream(); virtual Common::WriteStream *createWriteStream();
}; };
#endif /* CHROOT_FS_H */ #endif /* CHROOT_FS_H */

View file

@ -104,13 +104,13 @@ int main(int argc, char **argv) {
_window = [[UIWindow alloc] initWithFrame:rect]; _window = [[UIWindow alloc] initWithFrame:rect];
[_window retain]; [_window retain];
_controller = [[ScummVMViewController alloc] init]; _controller = [[ScummVMViewController alloc] init];
_view = [[iPhoneView alloc] initWithFrame:rect]; _view = [[iPhoneView alloc] initWithFrame:rect];
_view.multipleTouchEnabled = YES; _view.multipleTouchEnabled = YES;
_controller.view = _view; _controller.view = _view;
[_window setRootViewController:_controller]; [_window setRootViewController:_controller];
[_window makeKeyAndVisible]; [_window makeKeyAndVisible];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

View file

@ -90,7 +90,7 @@ OSystem_IPHONE::~OSystem_IPHONE() {
} }
bool OSystem_IPHONE::touchpadModeEnabled() const { bool OSystem_IPHONE::touchpadModeEnabled() const {
return _touchpadModeEnabled; return _touchpadModeEnabled;
} }
int OSystem_IPHONE::timerHandler(int t) { int OSystem_IPHONE::timerHandler(int t) {

View file

@ -755,7 +755,7 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO"); ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO");
ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0"); ADD_SETTING(iPhone_Debug, "GCC_OPTIMIZATION_LEVEL", "0");
ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO"); ADD_SETTING(iPhone_Debug, "GCC_PRECOMPILE_PREFIX_HEADER", "NO");
ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO"); ADD_SETTING(iPhone_Debug, "GCC_WARN_64_TO_32_BIT_CONVERSION", "NO");
ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", ""); ADD_SETTING_QUOTE(iPhone_Debug, "GCC_PREFIX_HEADER", "");
ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO"); ADD_SETTING(iPhone_Debug, "GCC_THUMB_SUPPORT", "NO");
ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES"); ADD_SETTING(iPhone_Debug, "GCC_UNROLL_LOOPS", "YES");