shill: implement Manager.GetService (error-case only)

BUG=chromium-os:20254
TEST=unittests, WiFiManager/000_SSID_Length_Limit

this gives us enough to pass the autotest for
network_WiFiManager/000_SSID_Length_Limit.

Change-Id: Ib0305e707d2203327d846be3e0b206033d6a884a
Reviewed-on: http://gerrit.chromium.org/gerrit/7567
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
diff --git a/key_value_store.cc b/key_value_store.cc
new file mode 100644
index 0000000..bc0f55b
--- /dev/null
+++ b/key_value_store.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "shill/key_value_store.h"
+
+#include <base/logging.h>
+#include <base/stl_util-inl.h>
+
+using std::map;
+using std::string;
+
+namespace shill {
+
+KeyValueStore::KeyValueStore() {}
+
+bool KeyValueStore::ContainsBool(const string &name) const {
+  return ContainsKey(bool_properties_, name);
+}
+
+bool KeyValueStore::ContainsString(const string &name) const {
+  return ContainsKey(string_properties_, name);
+}
+
+bool KeyValueStore::GetBool(const string &name) const {
+  map<string, bool>::const_iterator it(bool_properties_.find(name));
+  CHECK(it != bool_properties_.end());
+  return it->second;
+}
+
+const string &KeyValueStore::GetString(const string &name) const {
+  map<string, string>::const_iterator it(string_properties_.find(name));
+  CHECK(it != string_properties_.end());
+  return it->second;
+}
+
+void KeyValueStore::SetBool(const string &name, bool value) {
+  bool_properties_[name] = value;
+}
+
+void KeyValueStore::SetString(const string &name, const string &value) {
+  string_properties_[name] = value;
+}
+
+}  // namespace shill