mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 1 | // Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_STUB_STORAGE_H_ |
| 6 | #define SHILL_STUB_STORAGE_H_ |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 7 | |
| 8 | #include <set> |
| 9 | #include <string> |
| 10 | #include <vector> |
| 11 | |
mukesh agrawal | 0414747 | 2015-08-18 13:25:28 -0700 | [diff] [blame^] | 12 | #include <base/files/file_path.h> |
| 13 | |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 14 | #include "shill/store_interface.h" |
| 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | // A stub implementation of StoreInterface. |
| 19 | class StubStorage : public StoreInterface { |
| 20 | public: |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 21 | ~StubStorage() override {} |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 22 | |
mukesh agrawal | 0414747 | 2015-08-18 13:25:28 -0700 | [diff] [blame^] | 23 | void set_path(const base::FilePath& path) override {} |
| 24 | const base::FilePath& path() const override { return default_path_; } |
| 25 | bool IsNonEmpty() const override { return false; } |
| 26 | bool Open() override { return false; } |
| 27 | bool Close() override { return false; } |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 28 | bool Flush() override { return false; } |
mukesh agrawal | 0414747 | 2015-08-18 13:25:28 -0700 | [diff] [blame^] | 29 | bool MarkAsCorrupted() override { return false; } |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 30 | std::set<std::string> GetGroups() const override { return {}; } |
| 31 | std::set<std::string> GetGroupsWithKey( |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 32 | const std::string& key) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 33 | return {}; |
| 34 | } |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 35 | std::set<std::string> GetGroupsWithProperties( |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 36 | const KeyValueStore& properties) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 37 | return {}; |
| 38 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 39 | bool ContainsGroup(const std::string& group) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 40 | return false; |
| 41 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 42 | bool DeleteKey(const std::string& group, const std::string& key) |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 43 | override { return false; } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 44 | bool DeleteGroup(const std::string& group) override { return false; } |
| 45 | bool SetHeader(const std::string& header) override { return false; } |
| 46 | bool GetString(const std::string& group, |
| 47 | const std::string& key, |
| 48 | std::string* value) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 49 | return false; |
| 50 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 51 | bool SetString(const std::string& group, |
| 52 | const std::string& key, |
| 53 | const std::string& value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 54 | return false; |
| 55 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 56 | bool GetBool(const std::string& group, |
| 57 | const std::string& key, |
| 58 | bool* value) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 59 | return false; |
| 60 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 61 | bool SetBool(const std::string& group, |
| 62 | const std::string& key, |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 63 | bool value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 64 | return false; |
| 65 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 66 | bool GetInt(const std::string& group, |
| 67 | const std::string& key, |
| 68 | int* value) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 69 | return false; |
| 70 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 71 | bool SetInt(const std::string& group, |
| 72 | const std::string& key, |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 73 | int value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 74 | return false; |
| 75 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 76 | bool GetUint64(const std::string& group, |
| 77 | const std::string& key, |
| 78 | uint64_t* value) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 79 | return false; |
| 80 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 81 | bool SetUint64(const std::string& group, |
| 82 | const std::string& key, |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 83 | uint64_t value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 84 | return false; |
| 85 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 86 | bool GetStringList(const std::string& group, |
| 87 | const std::string& key, |
| 88 | std::vector<std::string>* value) const override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 89 | return false; |
| 90 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 91 | bool SetStringList(const std::string& group, |
| 92 | const std::string& key, |
| 93 | const std::vector<std::string>& value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 94 | return false; |
| 95 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 96 | bool GetCryptedString(const std::string& group, |
| 97 | const std::string& key, |
| 98 | std::string* value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 99 | return false; |
| 100 | } |
Paul Stewart | 1a212a6 | 2015-06-16 13:13:10 -0700 | [diff] [blame] | 101 | bool SetCryptedString(const std::string& group, |
| 102 | const std::string& key, |
| 103 | const std::string& value) override { |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 104 | return false; |
| 105 | } |
mukesh agrawal | 0414747 | 2015-08-18 13:25:28 -0700 | [diff] [blame^] | 106 | |
| 107 | private: |
| 108 | const base::FilePath default_path_; // non-static since non-POD. |
mukesh agrawal | 92496a4 | 2014-04-08 16:04:43 -0700 | [diff] [blame] | 109 | }; |
| 110 | |
| 111 | } // namespace shill |
| 112 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 113 | #endif // SHILL_STUB_STORAGE_H_ |