1 // 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 // 16 17 #ifndef SHILL_STUB_STORAGE_H_ 18 #define SHILL_STUB_STORAGE_H_ 19 20 #include <set> 21 #include <string> 22 #include <vector> 23 24 #include "shill/store_interface.h" 25 26 namespace shill { 27 28 // A stub implementation of StoreInterface. 29 class StubStorage : public StoreInterface { 30 public: 31 ~StubStorage() override {} 32 33 bool IsNonEmpty() const override { return false; } 34 bool Open() override { return false; } 35 bool Close() override { return false; } 36 bool Flush() override { return false; } 37 bool MarkAsCorrupted() override { return false; } 38 std::set<std::string> GetGroups() const override { return {}; } 39 std::set<std::string> GetGroupsWithKey( 40 const std::string& key) const override { 41 return {}; 42 } 43 std::set<std::string> GetGroupsWithProperties( 44 const KeyValueStore& properties) const override { 45 return {}; 46 } 47 bool ContainsGroup(const std::string& group) const override { 48 return false; 49 } 50 bool DeleteKey(const std::string& group, const std::string& key) 51 override { return false; } 52 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 { 57 return false; 58 } 59 bool SetString(const std::string& group, 60 const std::string& key, 61 const std::string& value) override { 62 return false; 63 } 64 bool GetBool(const std::string& group, 65 const std::string& key, 66 bool* value) const override { 67 return false; 68 } 69 bool SetBool(const std::string& group, 70 const std::string& key, 71 bool value) override { 72 return false; 73 } 74 bool GetInt(const std::string& group, 75 const std::string& key, 76 int* value) const override { 77 return false; 78 } 79 bool SetInt(const std::string& group, 80 const std::string& key, 81 int value) override { 82 return false; 83 } 84 bool GetUint64(const std::string& group, 85 const std::string& key, 86 uint64_t* value) const override { 87 return false; 88 } 89 bool SetUint64(const std::string& group, 90 const std::string& key, 91 uint64_t value) override { 92 return false; 93 } 94 bool GetStringList(const std::string& group, 95 const std::string& key, 96 std::vector<std::string>* value) const override { 97 return false; 98 } 99 bool SetStringList(const std::string& group, 100 const std::string& key, 101 const std::vector<std::string>& value) override { 102 return false; 103 } 104 bool GetCryptedString(const std::string& group, 105 const std::string& key, 106 std::string* value) override { 107 return false; 108 } 109 bool SetCryptedString(const std::string& group, 110 const std::string& key, 111 const std::string& value) override { 112 return false; 113 } 114 }; 115 116 } // namespace shill 117 118 #endif // SHILL_STUB_STORAGE_H_ 119