mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
* class now only contains DBus related code * other functions have been moved to CTesting
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d1827bd162
commit
dc1d5d8586
45
src/blackmisc/dbusutils.h
Normal file
45
src/blackmisc/dbusutils.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2017
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_DBUSUTILS_H
|
||||
#define BLACKMISC_DBUSUTILS_H
|
||||
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include <QDBusArgument>
|
||||
#include <QTextStream>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
//! Utils for UNIT tests / samples
|
||||
class BLACKMISC_EXPORT CDBusUtils
|
||||
{
|
||||
public:
|
||||
//! Get QDBusArgument signature (formatted)
|
||||
static QString getQDBusArgumentSignature(const QDBusArgument &arg, int level = 0);
|
||||
|
||||
//! Signature for BlackMisc::CValueObject
|
||||
template<typename ValueObj>
|
||||
static QString dBusSignature(const ValueObj &obj)
|
||||
{
|
||||
QDBusArgument arg;
|
||||
obj.marshallToDbus(arg);
|
||||
return arg.currentSignature();
|
||||
}
|
||||
|
||||
//! Type as string
|
||||
static QString dbusTypeAsString(QDBusArgument::ElementType type);
|
||||
|
||||
//! Show some (important) DBus signatures
|
||||
static void showDBusSignatures(QTextStream &out);
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user