refs #875, refs #879, renamed CTestUtils to CDBusUtils

* class now only contains DBus related code
* other functions have been moved to CTesting
This commit is contained in:
Klaus Basan
2017-02-11 13:00:20 +01:00
committed by Mathew Sutcliffe
parent d1827bd162
commit dc1d5d8586
8 changed files with 157 additions and 165 deletions

45
src/blackmisc/dbusutils.h Normal file
View 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