blob: 6490496bc5ab2be4c410a4395525000319a1a25b [file] [log] [blame]
Peter Qiuc0beca52015-09-03 11:25:46 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
mukesh agrawal92496a42014-04-08 16:04:43 -070016
Ben Chanc45688b2014-07-02 23:50:45 -070017#ifndef SHILL_STUB_STORAGE_H_
18#define SHILL_STUB_STORAGE_H_
mukesh agrawal92496a42014-04-08 16:04:43 -070019
20#include <set>
21#include <string>
22#include <vector>
23
24#include "shill/store_interface.h"
25
26namespace shill {
27
28// A stub implementation of StoreInterface.
29class StubStorage : public StoreInterface {
30 public:
Ben Chan5ea763b2014-08-13 11:07:54 -070031 ~StubStorage() override {}
mukesh agrawal92496a42014-04-08 16:04:43 -070032
mukesh agrawal04147472015-08-18 13:25:28 -070033 bool IsNonEmpty() const override { return false; }
34 bool Open() override { return false; }
35 bool Close() override { return false; }
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070036 bool Flush() override { return false; }
mukesh agrawal04147472015-08-18 13:25:28 -070037 bool MarkAsCorrupted() override { return false; }
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070038 std::set<std::string> GetGroups() const override { return {}; }
39 std::set<std::string> GetGroupsWithKey(
Paul Stewart1a212a62015-06-16 13:13:10 -070040 const std::string& key) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070041 return {};
42 }
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070043 std::set<std::string> GetGroupsWithProperties(
Paul Stewart1a212a62015-06-16 13:13:10 -070044 const KeyValueStore& properties) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070045 return {};
46 }
Paul Stewart1a212a62015-06-16 13:13:10 -070047 bool ContainsGroup(const std::string& group) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070048 return false;
49 }
Paul Stewart1a212a62015-06-16 13:13:10 -070050 bool DeleteKey(const std::string& group, const std::string& key)
mukesh agrawal92496a42014-04-08 16:04:43 -070051 override { return false; }
Paul Stewart1a212a62015-06-16 13:13:10 -070052 bool DeleteGroup(const std::string& group) override { return false; }
53 bool SetHeader(const std::string& header) override { return false; }
54 bool GetString(const std::string& group,
55 const std::string& key,
56 std::string* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070057 return false;
58 }
Paul Stewart1a212a62015-06-16 13:13:10 -070059 bool SetString(const std::string& group,
60 const std::string& key,
61 const std::string& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070062 return false;
63 }
Paul Stewart1a212a62015-06-16 13:13:10 -070064 bool GetBool(const std::string& group,
65 const std::string& key,
66 bool* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070067 return false;
68 }
Paul Stewart1a212a62015-06-16 13:13:10 -070069 bool SetBool(const std::string& group,
70 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070071 bool value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070072 return false;
73 }
Paul Stewart1a212a62015-06-16 13:13:10 -070074 bool GetInt(const std::string& group,
75 const std::string& key,
76 int* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070077 return false;
78 }
Paul Stewart1a212a62015-06-16 13:13:10 -070079 bool SetInt(const std::string& group,
80 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070081 int value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070082 return false;
83 }
Paul Stewart1a212a62015-06-16 13:13:10 -070084 bool GetUint64(const std::string& group,
85 const std::string& key,
86 uint64_t* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070087 return false;
88 }
Paul Stewart1a212a62015-06-16 13:13:10 -070089 bool SetUint64(const std::string& group,
90 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070091 uint64_t value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070092 return false;
93 }
Paul Stewart1a212a62015-06-16 13:13:10 -070094 bool GetStringList(const std::string& group,
95 const std::string& key,
96 std::vector<std::string>* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070097 return false;
98 }
Paul Stewart1a212a62015-06-16 13:13:10 -070099 bool SetStringList(const std::string& group,
100 const std::string& key,
101 const std::vector<std::string>& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -0700102 return false;
103 }
Paul Stewart1a212a62015-06-16 13:13:10 -0700104 bool GetCryptedString(const std::string& group,
105 const std::string& key,
106 std::string* value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -0700107 return false;
108 }
Paul Stewart1a212a62015-06-16 13:13:10 -0700109 bool SetCryptedString(const std::string& group,
110 const std::string& key,
111 const std::string& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -0700112 return false;
113 }
114};
115
116} // namespace shill
117
Ben Chanc45688b2014-07-02 23:50:45 -0700118#endif // SHILL_STUB_STORAGE_H_