PenetrateBase/PenetrateBasic/main.cpp

70 lines
1.5 KiB
C++

#include <QtCore/QCoreApplication>
#include <qdebug.h>
#include "cmds_basic.h"
#include "dispatch.h"
#include "cmds.h"
#include "validate.h"
#include "validate_impl.h"
#include "validate_depict.h"
int vp(int c);
cmds::T<int(int)>::Cmd<vp> entry("hello");
verify::T<int(int)>::Validate<vp> vp_check;
auto args0 = vp_check.pos<0>() & new impls::Int32Limit<true, true>(u8"Hello World", 0, 3);
namespace xproc {
int xmp(int arg) {
qDebug() << "xmp";
return 3;
}
}
cmds::T<int(int)>::Cmd<xproc::xmp> xvv("sfaf");
template<> void datas::dataSet<int>(IDataObject& object, const QString& key, int value) {
auto argx = object.newObject();
argx->setString(u8"Type", u8"int");
argx->setInt32(u8"Value", value);
object.setChild(key, argx);
}
template<> int datas::dataGet<int>(IDataObject& object, const QString& key) {
return object.getInt32(key);
}
#include "logs_port.h"
using namespace Inlet;
int main(int argc, char* argv[]) {
QCoreApplication a(argc, argv);
auto logs = std::make_shared<logs::LogsOutput>(QDir(u8"./"));
dispatch::Dispatch::unique()->loadOutput(logs);
SignatureImpl<int, int> v(3);
v.execute(vp);
Callable<int, int> vptr = vp;
CmdsImpl<(void*) vp, int, int> exec;
exec.execute(5);
entry(50);
entry(2);
entry(0);
entry(3);
xvv(2);
depict::ValidateDocObject doc;
dispatch::Dispatch::unique()->getValidateDepict(doc);
qDebug().noquote() << doc.toText();
logs->flush(true);
return a.exec();
}
int vp(int c) {
qDebug() << c;
return c;
}