Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
Executable
+48
@@ -0,0 +1,48 @@
|
||||
|
||||
|
||||
|
||||
#include "function_reply_object.h"
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
namespace Core
|
||||
{
|
||||
|
||||
FunctionReplyObject &FunctionReplyObject::arg(qint64 val)
|
||||
{
|
||||
m_args.push_back(std::to_string(val));
|
||||
return *this;
|
||||
}
|
||||
|
||||
FunctionReplyObject &FunctionReplyObject::arg(const std::string &str)
|
||||
{
|
||||
m_args.push_back(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
FunctionReplyObject &FunctionReplyObject::arg(const QString &str)
|
||||
{
|
||||
m_args.push_back(str.toStdString());
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string FunctionReplyObject::operator()() const
|
||||
{
|
||||
if (m_args.empty())
|
||||
return m_str;
|
||||
|
||||
QString ret(QString::fromStdString(m_str));
|
||||
for (const std::string &s : m_args)
|
||||
ret = ret.arg(QString::fromStdString(s));
|
||||
return ret.toStdString();
|
||||
}
|
||||
|
||||
QString FunctionReplyObject::translated() const
|
||||
{
|
||||
QString ret(QCoreApplication::translate("dds", m_str.c_str()));
|
||||
for (const std::string &s : m_args)
|
||||
ret = ret.arg(QString::fromStdString(s));
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user