Line | |
---|
1 |
|
---|
2 | /* -------------------------------------------------------------------------
|
---|
3 | * BKG NTRIP Client
|
---|
4 | * -------------------------------------------------------------------------
|
---|
5 | *
|
---|
6 | * Class: bncApp
|
---|
7 | *
|
---|
8 | * Purpose: This class implements the main application
|
---|
9 | *
|
---|
10 | * Author: L. Mervart
|
---|
11 | *
|
---|
12 | * Created: 29-Aug-2006
|
---|
13 | *
|
---|
14 | * Changes:
|
---|
15 | *
|
---|
16 | * -----------------------------------------------------------------------*/
|
---|
17 |
|
---|
18 | #include <iostream>
|
---|
19 |
|
---|
20 | #include "bncapp.h"
|
---|
21 |
|
---|
22 | using namespace std;
|
---|
23 |
|
---|
24 | // Constructor
|
---|
25 | ////////////////////////////////////////////////////////////////////////////
|
---|
26 | bncApp::bncApp(int argc, char* argv[], bool GUIenabled) :
|
---|
27 | QApplication(argc, argv, GUIenabled) {
|
---|
28 |
|
---|
29 | _logFile = 0;
|
---|
30 | _logStream = 0;
|
---|
31 | for (int ii = 1; ii < argc; ii++) {
|
---|
32 | if (QString(argv[ii]) == "-o" && ii+1 < argc) {
|
---|
33 | _logFile = new QFile(argv[ii+1]);
|
---|
34 | _logFile->open(QIODevice::WriteOnly);
|
---|
35 | _logStream = new QTextStream();
|
---|
36 | _logStream->setDevice(_logFile);
|
---|
37 | }
|
---|
38 | }
|
---|
39 | }
|
---|
40 |
|
---|
41 | // Destructor
|
---|
42 | ////////////////////////////////////////////////////////////////////////////
|
---|
43 | bncApp::~bncApp() {
|
---|
44 | delete _logStream;
|
---|
45 | delete _logFile;
|
---|
46 | }
|
---|
47 |
|
---|
48 | // Write a Program Message
|
---|
49 | ////////////////////////////////////////////////////////////////////////////
|
---|
50 | void bncApp::slotMessage(const QByteArray msg) {
|
---|
51 | if (_logStream) {
|
---|
52 | *_logStream << msg.data() << endl;
|
---|
53 | _logStream->flush();
|
---|
54 | }
|
---|
55 | else {
|
---|
56 | cerr << msg.data() << endl;
|
---|
57 | }
|
---|
58 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.