mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
committed by
Mathew Sutcliffe
parent
c6da7b0d35
commit
ded6fc012e
67
src/blackmisc/valueobject.cpp
Normal file
67
src/blackmisc/valueobject.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
#include "valueobject.h"
|
||||
#include "valuemap.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
CValueObject::CValueObject() {}
|
||||
|
||||
/*
|
||||
* Stringify
|
||||
*/
|
||||
QString CValueObject::toQString(bool i18n) const
|
||||
{
|
||||
return this->convertToQString(i18n);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stringify
|
||||
*/
|
||||
QString CValueObject::toFormattedQString(bool i18n) const
|
||||
{
|
||||
return this->toQString(i18n);
|
||||
}
|
||||
|
||||
/*
|
||||
* Stringify
|
||||
*/
|
||||
std::string CValueObject::toStdString(bool i18n) const
|
||||
{
|
||||
return this->convertToQString(i18n).toStdString();
|
||||
}
|
||||
|
||||
/*
|
||||
* Streaming
|
||||
*/
|
||||
QString CValueObject::stringForStreaming() const
|
||||
{
|
||||
// simplest default implementation requires only one method
|
||||
return this->convertToQString();
|
||||
}
|
||||
|
||||
/*
|
||||
* from DBus
|
||||
*/
|
||||
const QDBusArgument &operator>>(const QDBusArgument &argument, CValueObject &uc)
|
||||
{
|
||||
argument.beginStructure();
|
||||
uc.unmarshallFromDbus(argument);
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
|
||||
/*
|
||||
* to DBus
|
||||
*/
|
||||
QDBusArgument &operator<<(QDBusArgument &argument, const CValueObject &uc)
|
||||
{
|
||||
argument.beginStructure();
|
||||
uc.marshallToDbus(argument);
|
||||
argument.endStructure();
|
||||
return argument;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user