blob: 925fa5ebb68361ef4a66b485ae881a55b18ed984 [file] [log] [blame]
mukesh agrawal92496a42014-04-08 16:04:43 -07001// 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 Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_STUB_STORAGE_H_
6#define SHILL_STUB_STORAGE_H_
mukesh agrawal92496a42014-04-08 16:04:43 -07007
8#include <set>
9#include <string>
10#include <vector>
11
mukesh agrawal04147472015-08-18 13:25:28 -070012#include <base/files/file_path.h>
13
mukesh agrawal92496a42014-04-08 16:04:43 -070014#include "shill/store_interface.h"
15
16namespace shill {
17
18// A stub implementation of StoreInterface.
19class StubStorage : public StoreInterface {
20 public:
Ben Chan5ea763b2014-08-13 11:07:54 -070021 ~StubStorage() override {}
mukesh agrawal92496a42014-04-08 16:04:43 -070022
mukesh agrawal04147472015-08-18 13:25:28 -070023 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 Vakulenko016fa0e2014-08-11 15:59:58 -070028 bool Flush() override { return false; }
mukesh agrawal04147472015-08-18 13:25:28 -070029 bool MarkAsCorrupted() override { return false; }
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070030 std::set<std::string> GetGroups() const override { return {}; }
31 std::set<std::string> GetGroupsWithKey(
Paul Stewart1a212a62015-06-16 13:13:10 -070032 const std::string& key) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070033 return {};
34 }
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070035 std::set<std::string> GetGroupsWithProperties(
Paul Stewart1a212a62015-06-16 13:13:10 -070036 const KeyValueStore& properties) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070037 return {};
38 }
Paul Stewart1a212a62015-06-16 13:13:10 -070039 bool ContainsGroup(const std::string& group) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070040 return false;
41 }
Paul Stewart1a212a62015-06-16 13:13:10 -070042 bool DeleteKey(const std::string& group, const std::string& key)
mukesh agrawal92496a42014-04-08 16:04:43 -070043 override { return false; }
Paul Stewart1a212a62015-06-16 13:13:10 -070044 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 agrawal92496a42014-04-08 16:04:43 -070049 return false;
50 }
Paul Stewart1a212a62015-06-16 13:13:10 -070051 bool SetString(const std::string& group,
52 const std::string& key,
53 const std::string& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070054 return false;
55 }
Paul Stewart1a212a62015-06-16 13:13:10 -070056 bool GetBool(const std::string& group,
57 const std::string& key,
58 bool* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070059 return false;
60 }
Paul Stewart1a212a62015-06-16 13:13:10 -070061 bool SetBool(const std::string& group,
62 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070063 bool value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070064 return false;
65 }
Paul Stewart1a212a62015-06-16 13:13:10 -070066 bool GetInt(const std::string& group,
67 const std::string& key,
68 int* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070069 return false;
70 }
Paul Stewart1a212a62015-06-16 13:13:10 -070071 bool SetInt(const std::string& group,
72 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070073 int value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070074 return false;
75 }
Paul Stewart1a212a62015-06-16 13:13:10 -070076 bool GetUint64(const std::string& group,
77 const std::string& key,
78 uint64_t* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070079 return false;
80 }
Paul Stewart1a212a62015-06-16 13:13:10 -070081 bool SetUint64(const std::string& group,
82 const std::string& key,
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070083 uint64_t value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070084 return false;
85 }
Paul Stewart1a212a62015-06-16 13:13:10 -070086 bool GetStringList(const std::string& group,
87 const std::string& key,
88 std::vector<std::string>* value) const override {
mukesh agrawal92496a42014-04-08 16:04:43 -070089 return false;
90 }
Paul Stewart1a212a62015-06-16 13:13:10 -070091 bool SetStringList(const std::string& group,
92 const std::string& key,
93 const std::vector<std::string>& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070094 return false;
95 }
Paul Stewart1a212a62015-06-16 13:13:10 -070096 bool GetCryptedString(const std::string& group,
97 const std::string& key,
98 std::string* value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -070099 return false;
100 }
Paul Stewart1a212a62015-06-16 13:13:10 -0700101 bool SetCryptedString(const std::string& group,
102 const std::string& key,
103 const std::string& value) override {
mukesh agrawal92496a42014-04-08 16:04:43 -0700104 return false;
105 }
mukesh agrawal04147472015-08-18 13:25:28 -0700106
107 private:
108 const base::FilePath default_path_; // non-static since non-POD.
mukesh agrawal92496a42014-04-08 16:04:43 -0700109};
110
111} // namespace shill
112
Ben Chanc45688b2014-07-02 23:50:45 -0700113#endif // SHILL_STUB_STORAGE_H_