armansito | f436464 | 2014-09-06 02:49:34 +0900 | [diff] [blame] | 1 | // Copyright 2014 The Chromium 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 | #ifndef DBUS_UTIL_H_ |
| 6 | #define DBUS_UTIL_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "dbus/dbus_export.h" |
| 11 | |
| 12 | namespace dbus { |
| 13 | |
| 14 | // Returns the absolute name of a member by concatanating |interface_name| and |
| 15 | // |member_name|. e.g.: |
| 16 | // GetAbsoluteMemberName( |
| 17 | // "org.freedesktop.DBus.Properties", |
| 18 | // "PropertiesChanged") |
| 19 | // |
| 20 | // => "org.freedesktop.DBus.Properties.PropertiesChanged" |
| 21 | // |
| 22 | CHROME_DBUS_EXPORT std::string GetAbsoluteMemberName( |
| 23 | const std::string& interface_name, |
| 24 | const std::string& member_name); |
| 25 | |
hashimoto | b6084f5 | 2015-03-30 15:52:21 +0900 | [diff] [blame] | 26 | // Similar to base::DeletePointer, but takes void* as an argument. |
| 27 | // Used as DBusFreeFunction. |
| 28 | template<typename T> |
| 29 | void DeleteVoidPointer(void* memory) { |
| 30 | delete static_cast<T*>(memory); |
| 31 | } |
| 32 | |
armansito | f436464 | 2014-09-06 02:49:34 +0900 | [diff] [blame] | 33 | } // namespace dbus |
| 34 | |
| 35 | #endif // DBUS_UTIL_H_ |