Chris Masone | 8fe2c7e | 2011-06-09 15:51:19 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | |
| 5 | #include "shill/property_store_interface.h" |
| 6 | |
| 7 | #include <map> |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <base/basictypes.h> |
| 12 | #include <base/logging.h> |
| 13 | |
| 14 | #include "shill/error.h" |
| 15 | |
| 16 | using std::map; |
| 17 | using std::string; |
| 18 | using std::vector; |
| 19 | |
| 20 | namespace shill { |
| 21 | |
| 22 | PropertyStoreInterface::PropertyStoreInterface() {} |
| 23 | |
| 24 | PropertyStoreInterface::~PropertyStoreInterface() {} |
| 25 | |
| 26 | bool PropertyStoreInterface::SetBoolProperty(const std::string& name, |
| 27 | bool value, |
| 28 | Error *error) { |
| 29 | return ReturnError(name, error); |
| 30 | } |
| 31 | |
| 32 | bool PropertyStoreInterface::SetInt16Property(const std::string& name, |
| 33 | int16 value, |
| 34 | Error *error) { |
| 35 | return ReturnError(name, error); |
| 36 | } |
| 37 | |
| 38 | bool PropertyStoreInterface::SetInt32Property(const std::string& name, |
| 39 | int32 value, |
| 40 | Error *error) { |
| 41 | return ReturnError(name, error); |
| 42 | } |
| 43 | |
| 44 | bool PropertyStoreInterface::SetStringProperty(const std::string& name, |
| 45 | const std::string& value, |
| 46 | Error *error) { |
| 47 | return ReturnError(name, error); |
| 48 | } |
| 49 | |
| 50 | bool PropertyStoreInterface::SetStringmapProperty( |
| 51 | const std::string& name, |
| 52 | const std::map<std::string, std::string>& values, |
| 53 | Error *error) { |
| 54 | return ReturnError(name, error); |
| 55 | } |
| 56 | |
| 57 | bool PropertyStoreInterface::SetStringsProperty( |
| 58 | const std::string& name, |
| 59 | const std::vector<std::string>& values, |
| 60 | Error *error) { |
| 61 | return ReturnError(name, error); |
| 62 | } |
| 63 | |
| 64 | bool PropertyStoreInterface::SetUint8Property(const std::string& name, |
| 65 | uint8 value, |
| 66 | Error *error) { |
| 67 | return ReturnError(name, error); |
| 68 | } |
| 69 | |
| 70 | bool PropertyStoreInterface::SetUint16Property(const std::string& name, |
| 71 | uint16 value, |
| 72 | Error *error) { |
| 73 | return ReturnError(name, error); |
| 74 | } |
| 75 | |
| 76 | bool PropertyStoreInterface::SetUint32Property(const std::string& name, |
| 77 | uint32 value, |
| 78 | Error *error) { |
| 79 | return ReturnError(name, error); |
| 80 | } |
| 81 | |
| 82 | bool PropertyStoreInterface::ReturnError(const std::string& name, |
| 83 | Error *error) { |
| 84 | NOTIMPLEMENTED() << name << " is not writable."; |
| 85 | if (error) |
| 86 | error->Populate(Error::kInvalidArguments, name + " is not writable."); |
| 87 | return false; |
| 88 | } |
| 89 | |
| 90 | } // namespace shill |