diff options
author | Alexander Tkachev | 2016-05-28 01:08:51 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 827c7e43da118f12ae614530340a566a23c42746 (patch) | |
tree | d375bdec6ad763695722b8bd8c0c63647c7296f4 /backends/cloud/onedrive/onedrivelistdirectoryrequest.h | |
parent | 14d60e62f8452dd433fcf275cd87fd9b8c3bd6fd (diff) | |
download | scummvm-rg350-827c7e43da118f12ae614530340a566a23c42746.tar.gz scummvm-rg350-827c7e43da118f12ae614530340a566a23c42746.tar.bz2 scummvm-rg350-827c7e43da118f12ae614530340a566a23c42746.zip |
CLOUD: Add OneDriveListDirectoryRequest
Works as charm.
Diffstat (limited to 'backends/cloud/onedrive/onedrivelistdirectoryrequest.h')
-rw-r--r-- | backends/cloud/onedrive/onedrivelistdirectoryrequest.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/backends/cloud/onedrive/onedrivelistdirectoryrequest.h b/backends/cloud/onedrive/onedrivelistdirectoryrequest.h new file mode 100644 index 0000000000..61eebb2669 --- /dev/null +++ b/backends/cloud/onedrive/onedrivelistdirectoryrequest.h @@ -0,0 +1,64 @@ +/* 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 BACKENDS_CLOUD_ONEDRIVE_ONEDRIVELISTDIRECTORYREQUEST_H +#define BACKENDS_CLOUD_ONEDRIVE_ONEDRIVELISTDIRECTORYREQUEST_H + +#include "backends/cloud/storage.h" +#include "backends/networking/curl/curljsonrequest.h" +#include "backends/networking/curl/request.h" +#include "common/callback.h" + +namespace Cloud { +namespace OneDrive { + +class OneDriveStorage; + +class OneDriveListDirectoryRequest: public Networking::Request { + Common::String _requestedPath; + bool _requestedRecursive; + OneDriveStorage *_storage; + Storage::FileArrayCallback _filesCallback; + Common::Array<StorageFile> _files; + Common::Array<Common::String> _directoriesQueue; + Common::String _currentDirectory; + Request *_workingRequest; + bool _ignoreCallback; + + void start(); + void listNextDirectory(); + void listedDirectoryCallback(Networking::JsonResponse pair); + void makeRequest(Common::String url); + void finishFiles(Common::Array<StorageFile> &files); +public: + OneDriveListDirectoryRequest(OneDriveStorage *storage, Common::String path, Storage::FileArrayCallback cb, bool recursive = false); + virtual ~OneDriveListDirectoryRequest() { delete _filesCallback; } + + virtual void handle() {} + virtual void restart() { start(); } + virtual void finish(); +}; + +} //end of namespace OneDrive +} //end of namespace Cloud + +#endif |