ScummVM API documentation
cloud-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 CLOUD_FILESYSTEM_H
23
#define CLOUD_FILESYSTEM_H
24
25
#include "backends/fs/abstract-fs.h"
26
27
#ifdef USE_CLOUD
28
#include "backends/cloud/cloudmanager.h"
29
#include "backends/cloud/storage.h"
30
#include "backends/cloud/storagefile.h"
31
#include "backends/networking/http/connectionmanager.h"
32
#include "backends/networking/http/httpjsonrequest.h"
33
#include "backends/networking/http/request.h"
34
#endif
35
36
#include "backends/fs/posix/posix-fs.h"
37
43
class
CloudFilesystemNode
:
public
AbstractFSNode
{
44
#define CLOUD_FS_PATH "/cloud"
45
protected
:
46
static
Common::HashMap<Common::String, AbstractFSList>
_cloudFolders;
47
Common::String
_displayName;
48
Common::String
_path;
49
Common::String
_storageFileId;
50
bool
_isDirectory;
51
bool
_isValid;
52
56
CloudFilesystemNode
() : _isDirectory(false), _isValid(false), _storageFileId(nullptr) {}
57
58
virtual
AbstractFSNode
*makeNode(
const
Common::String
&path)
const
{
59
return
new
CloudFilesystemNode
(path);
60
}
61
65
void
directoryListedCallback
(
const
Cloud::Storage::ListDirectoryResponse
&response);
66
void
directoryListedErrorCallback(
const
Networking::ErrorResponse
&
error
);
67
void
fileDownloadedCallback(
const
Cloud::Storage::BoolResponse
&response);
68
void
fileDownloadedErrorCallback(
const
Networking::ErrorResponse
&error);
69
70
public
:
76
CloudFilesystemNode
(
const
Common::String
&path);
77
78
bool
exists()
const override
;
79
Common::U32String
getDisplayName
()
const override
{
return
_displayName; }
80
Common::String
getName
()
const override
{
return
_displayName; }
81
Common::String
getPath
()
const override
{
return
_path; }
82
bool
isDirectory
()
const override
{
return
_isDirectory; }
83
bool
isReadable
()
const override
;
84
bool
isWritable
()
const override
;
85
86
AbstractFSNode
*
getChild
(
const
Common::String
&n)
const override
;
87
bool
getChildren
(
AbstractFSList
&list,
ListMode
mode,
bool
hidden)
const override
;
88
AbstractFSNode
*
getParent
()
const override
;
89
90
Common::SeekableReadStream
*
createReadStream
()
override
;
91
Common::SeekableWriteStream
*
createWriteStream
(
bool
atomic)
override
;
92
bool
createDirectory
()
override
;
93
};
94
95
#endif
Common::String
Definition:
str.h:59
CloudFilesystemNode::createWriteStream
Common::SeekableWriteStream * createWriteStream(bool atomic) override
CloudFilesystemNode::isDirectory
bool isDirectory() const override
Definition:
cloud-fs.h:82
CloudFilesystemNode::getDisplayName
Common::U32String getDisplayName() const override
Definition:
cloud-fs.h:79
Networking::ErrorResponse
Definition:
request.h:73
Common::Array
Definition:
array.h:52
CloudFilesystemNode::createReadStream
Common::SeekableReadStream * createReadStream() override
CloudFilesystemNode::createDirectory
bool createDirectory() override
Networking::Response
Definition:
request.h:47
Common::SeekableReadStream
Definition:
stream.h:745
CloudFilesystemNode::getPath
Common::String getPath() const override
Definition:
cloud-fs.h:81
CloudFilesystemNode::CloudFilesystemNode
CloudFilesystemNode()
Definition:
cloud-fs.h:56
CloudFilesystemNode
Definition:
cloud-fs.h:43
CloudFilesystemNode::getParent
AbstractFSNode * getParent() const override
CloudFilesystemNode::directoryListedCallback
void directoryListedCallback(const Cloud::Storage::ListDirectoryResponse &response)
CloudFilesystemNode::getChild
AbstractFSNode * getChild(const Common::String &n) const override
CloudFilesystemNode::isWritable
bool isWritable() const override
CloudFilesystemNode::getChildren
bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override
Common::HashMap
Definition:
hashmap.h:85
Common::U32String
Definition:
ustr.h:57
Common::FSNode::ListMode
ListMode
Definition:
fs.h:86
CloudFilesystemNode::getName
Common::String getName() const override
Definition:
cloud-fs.h:80
CloudFilesystemNode::isReadable
bool isReadable() const override
error
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Common::SeekableWriteStream
Definition:
stream.h:351
AbstractFSNode
Definition:
abstract-fs.h:41
backends
fs
emscripten
cloud-fs.h
Generated on Wed Sep 3 2025 09:03:09 for ScummVM API documentation by
1.8.13