[shill] Add Profile objects

Add a mostly-empty Profile object and all the wiring to hook it up to DBus

BUG=chromium-os:17154
TEST=unit tests

Change-Id: I16bf488969f071dd91c31ef454c7e10a81f9afe7
Reviewed-on: http://gerrit.chromium.org/gerrit/3423
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/profile.cc b/profile.cc
new file mode 100644
index 0000000..8c0cece
--- /dev/null
+++ b/profile.cc
@@ -0,0 +1,48 @@
+// 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/profile.h"
+
+#include <string>
+
+#include <base/logging.h>
+#include <base/stl_util-inl.h>
+
+#include "shill/adaptor_interfaces.h"
+#include "shill/control_interface.h"
+#include "shill/dbus_adaptor.h"
+#include "shill/error.h"
+#include "shill/property_accessor.h"
+#include "shill/shill_event.h"
+
+using std::string;
+
+namespace shill {
+Profile::Profile(ControlInterface *control_interface)
+    : adaptor_(control_interface->CreateProfileAdaptor(this)) {
+}
+
+Profile::~Profile() {}
+
+bool Profile::SetBoolProperty(const string& name, bool value, Error *error) {
+  VLOG(2) << "Setting " << name << " as a bool.";
+  bool set = (ContainsKey(bool_properties_, name) &&
+              bool_properties_[name]->Set(value));
+  if (!set && error)
+    error->Populate(Error::kInvalidArguments, name + " is not a R/W bool.");
+  return set;
+}
+
+bool Profile::SetStringProperty(const string& name,
+                                const string& value,
+                                Error *error) {
+  VLOG(2) << "Setting " << name << " as a string.";
+  bool set = (ContainsKey(string_properties_, name) &&
+              string_properties_[name]->Set(value));
+  if (!set && error)
+    error->Populate(Error::kInvalidArguments, name + " is not a R/W string.");
+  return set;
+}
+
+}  // namespace shill