2 // MAIN -- a little demo of the capabilities of the "K3Process" class
4 // version 0.2, Aug 2nd 1997
6 // Copyright 1997 Christian Czezatke <e9025461@student.tuwien.ac.at>
10 #include "k3process.h"
14 #include <kaboutdata.h>
15 #include <kcmdlineargs.h>
16 #include <kcomponentdata.h>
17 #include <QtCore/QCoreApplication>
21 #include "k3prociotest.h"
26 // A nice input for "sort"... ;- )
28 static const char txt
[] = "hat\nder\nalte\nhexenmeister\nsich\ndoch\neinmal\nwegbegeben\n\
29 und\nnun\nsollen\nseine\ngeister\nsich\nnach\nmeinem\nwillen\nregen\nseine\nwort\nund\n\
30 werke\nmerkt\nich\nund\nden\nbrauch\nund\nmit\ngeistesstaerke\ntu\nich\nwunder\nauch\n";
33 int main(int argc
, char *argv
[])
37 KAboutData
about("kprociotest", 0, ki18n("kprociotest"), "version");
38 //KCmdLineArgs::init(argc, argv, &about);
39 KComponentData
cData(&about
);
41 QCoreApplication
app(argc
, argv
);
43 printf("Welcome to the K3ProcIO Demo Application!\n");
50 p
.connect(&p
, SIGNAL(processExited(K3Process
*)), &dummy
, SLOT(printMessage(K3Process
*)));
51 p
.connect(&p
, SIGNAL(readReady(K3ProcIO
*)), &dummy
, SLOT(gotOutput(K3ProcIO
*)));
56 printf("Start returns %s\n", b
? "true" : "false");
58 b
= p
.writeStdin(QString("Hello World!"));
59 printf("writeStdin returns %s\n", b
? "true" : "false");
61 b
= p
.writeStdin(QString("This is a test. It should come out in reverse (esrever)"));
62 printf("writeStdin returns %s\n", b
? "true" : "false");
66 printf("Entering man Qt event loop -- press <CTRL><C> to abort\n");
69 #include "k3prociotest.moc"