2016-05-11 01:10:37 +06: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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
#ifndef BACKENDS_CLOUD_STORAGE_H
|
|
|
|
#define BACKENDS_CLOUD_STORAGE_H
|
2016-05-11 01:10:37 +06:00
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
#include "common/str.h"
|
2016-05-13 17:23:28 +06:00
|
|
|
#include "common/array.h"
|
|
|
|
#include "backends/cloud/request.h"
|
2016-05-16 01:05:40 +06:00
|
|
|
#include "backends/networking/curl/connectionmanager.h"
|
2016-05-11 15:15:23 +06:00
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
namespace Cloud {
|
2016-05-11 15:15:23 +06:00
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
class Storage {
|
2016-05-12 18:52:57 +06:00
|
|
|
friend void cloudThread(void *); //calls handler()
|
2016-05-13 17:23:28 +06:00
|
|
|
bool _timerStarted;
|
2016-05-11 20:24:53 +06:00
|
|
|
|
|
|
|
protected:
|
2016-05-13 17:23:28 +06:00
|
|
|
Common::Array<Request *> _requests;
|
2016-05-16 01:05:40 +06:00
|
|
|
Networking::ConnectionManager _connectionManager;
|
2016-05-13 17:23:28 +06:00
|
|
|
|
|
|
|
virtual void addRequest(Request *request); //starts the timer if it's not started
|
|
|
|
virtual void handler();
|
|
|
|
virtual void startTimer(int interval = 1000000); //1 second is the default interval
|
|
|
|
virtual void stopTimer();
|
2016-05-11 15:15:23 +06:00
|
|
|
|
2016-05-11 01:10:37 +06:00
|
|
|
public:
|
2016-05-13 17:23:28 +06:00
|
|
|
Storage();
|
2016-05-11 20:24:53 +06:00
|
|
|
virtual ~Storage() {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Lists given directory.
|
|
|
|
*
|
|
|
|
* @param path directory to list
|
|
|
|
*/
|
|
|
|
|
2016-05-12 18:52:57 +06:00
|
|
|
//TODO: actually make it list directories
|
|
|
|
//TODO: add some callback to pass gathered files list
|
2016-05-11 12:31:26 +06:00
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
virtual void listDirectory(Common::String path) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Starts saves syncing process.
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void syncSaves() = 0;
|
2016-05-18 14:08:05 +06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints user info on console. (Temporary)
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void printInfo() = 0;
|
2016-05-11 01:10:37 +06:00
|
|
|
};
|
|
|
|
|
2016-05-11 20:24:53 +06:00
|
|
|
} //end of namespace Cloud
|
|
|
|
|
2016-05-11 01:10:37 +06:00
|
|
|
#endif
|