ScummVM API documentation
windows-fs.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef WINDOWS_FILESYSTEM_H
23#define WINDOWS_FILESYSTEM_H
24
25#include <windows.h>
26
27#include "backends/fs/abstract-fs.h"
28
29#include <io.h>
30#include <stdio.h>
31#include <stdlib.h>
32#include <tchar.h>
33
40protected:
41 Common::String _displayName;
42 Common::String _path;
43 bool _isDirectory;
44 bool _isPseudoRoot;
45 bool _isValid;
46
47public:
54
66 WindowsFilesystemNode(const Common::String &path, const bool currentDir);
67
68 bool exists() const override;
69 Common::U32String getDisplayName() const override { return _displayName; }
70 Common::String getName() const override { return _displayName; }
71 Common::String getPath() const override { return _path; }
72 bool isDirectory() const override { return _isDirectory; }
73 bool isReadable() const override;
74 bool isWritable() const override;
75
76 AbstractFSNode *getChild(const Common::String &n) const override;
77 bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
78 AbstractFSNode *getParent() const override;
79
82 bool createDirectory() override;
83
84private:
95 static void addFile(AbstractFSList &list, ListMode mode, const char *base, bool hidden, WIN32_FIND_DATA* find_data);
96
106 static const char *tcharToChar(const TCHAR *str);
107
117 static const TCHAR* charToTchar(const char *str);
118
122 virtual void setFlags();
123};
124
125#endif
Definition: abstract-fs.h:41
Definition: array.h:52
ListMode
Definition: fs.h:86
Definition: stream.h:745
Definition: stream.h:351
Definition: str.h:59
Definition: ustr.h:57
Definition: windows-fs.h:39
bool isReadable() const override
Common::SeekableReadStream * createReadStream() override
bool isWritable() const override
AbstractFSNode * getParent() const override
bool createDirectory() override
WindowsFilesystemNode(const Common::String &path, const bool currentDir)
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
Common::String getPath() const override
Definition: windows-fs.h:71
bool isDirectory() const override
Definition: windows-fs.h:72
Common::U32String getDisplayName() const override
Definition: windows-fs.h:69
Common::String getName() const override
Definition: windows-fs.h:70
AbstractFSNode * getChild(const Common::String &n) const override
Common::SeekableWriteStream * createWriteStream(bool atomic) override