blob: 00d5736c187276ad5038d59a0dfde4755d1fb0ad [file] [log] [blame]
Chris Masoned0ceb8c2011-06-02 10:05:39 -07001// 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 <string>
6
7#include <dbus-c++/dbus.h>
8
9#include "shill/dbus_adaptor.h"
10
11namespace shill {
12
13DBusAdaptor::DBusAdaptor(DBus::Connection* conn, const std::string& object_path)
14 : DBus::ObjectAdaptor(*conn, object_path) {
15}
16
17DBusAdaptor::~DBusAdaptor() {}
18
19// static
20::DBus::Variant DBusAdaptor::BoolToVariant(bool value) {
21 ::DBus::Variant v;
22 v.writer().append_bool(value);
23 return v;
24}
25
26// static
27::DBus::Variant DBusAdaptor::UInt32ToVariant(uint32 value) {
28 ::DBus::Variant v;
29 v.writer().append_uint32(value);
30 return v;
31}
32
33// static
34::DBus::Variant DBusAdaptor::IntToVariant(int value) {
35 ::DBus::Variant v;
36 v.writer().append_int32(value);
37 return v;
38}
39
40// static
41::DBus::Variant DBusAdaptor::StringToVariant(const std::string& value) {
42 ::DBus::Variant v;
43 v.writer().append_string(value.c_str());
44 return v;
45}
46
47} // namespace shill