2
* Copyright (C) 2016 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authors: James Henstridge <james.henstridge@canonical.com>
21
#include <unity/storage/provider/ProviderBase.h>
24
using namespace unity::storage::provider;
26
class TestProvider : public ProviderBase {
28
boost::future<ItemList> roots(Context const& ctx) override;
29
boost::future<tuple<ItemList,string>> list(
30
string const& item_id, string const& page_token,
31
Context const& ctx) override;
32
boost::future<ItemList> lookup(
33
string const& parent_id, string const& name,
34
Context const& ctx) override;
35
boost::future<Item> metadata(
36
string const& item_id, Context const& ctx) override;
37
boost::future<Item> create_folder(
38
string const& parent_id, string const& name,
39
Context const& ctx) override;
41
boost::future<unique_ptr<UploadJob>> create_file(
42
string const& parent_id, string const& name,
43
int64_t size, string const& content_type, bool allow_overwrite,
44
Context const& ctx) override;
45
boost::future<unique_ptr<UploadJob>> update(
46
string const& item_id, int64_t size, string const& old_etag,
47
Context const& ctx) override;
49
boost::future<unique_ptr<DownloadJob>> download(
50
string const& item_id, Context const& ctx) override;
52
boost::future<void> delete_item(
53
string const& item_id, Context const& ctx) override;
54
boost::future<Item> move(
55
string const& item_id, string const& new_parent_id,
56
string const& new_name, Context const& ctx) override;
57
boost::future<Item> copy(
58
string const& item_id, string const& new_parent_id,
59
string const& new_name, Context const& ctx) override;