Torc
0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
server
server/main.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) Mark Kendall 2012-18
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
// Qt
18
19
#include <QCoreApplication>
20
#include <QThread>
21
22
// Torc
23
#include "
torclocalcontext.h
"
24
#include "
torcexitcodes.h
"
25
#include "
torccommandline.h
"
26
#include "
torcxsdtest.h
"
27
28
int
main
(
int
argc,
char
**argv)
29
{
30
int
ret =
TORC_EXIT_OK
;
31
32
do
33
{
34
QCoreApplication torc(argc, argv);
35
QCoreApplication::setApplicationName(
TORC_REALM
);
36
QThread::currentThread()->setObjectName(
TORC_MAIN_THREAD
);
37
38
{
39
bool
justexit =
false
;
40
QScopedPointer<TorcCommandLine> cmdline(
new
TorcCommandLine
(
TorcCommandLine::Database
|
TorcCommandLine::LogFile
|
TorcCommandLine::XSDTest
));
41
42
if
(!cmdline.data())
43
return
TORC_EXIT_UNKOWN_ERROR
;
44
45
ret = cmdline->Evaluate(argc, argv, justexit);
46
47
if
(ret !=
TORC_EXIT_OK
)
48
return
ret;
49
50
if
(justexit)
51
return
ret;
52
53
if
(!(cmdline.data()->GetValue(QStringLiteral(
"xsdtest"
)).toString().isEmpty()))
54
return
TorcXSDTest::RunXSDTestSuite
(cmdline.data());
55
56
if
(
int
error =
TorcLocalContext::Create
(cmdline.data()))
57
return
error;
58
}
59
60
ret = qApp->exec();
61
TorcLocalContext::TearDown
();
62
63
}
while
(ret ==
TORC_EXIT_RESTART
);
64
65
return
ret;
66
}
67
TorcLocalContext::Create
static qint16 Create(TorcCommandLine *CommandLine, bool Init=true)
Definition:
torclocalcontext.cpp:65
TorcCommandLine
Torc command line handler.
Definition:
torccommandline.h:14
TORC_EXIT_RESTART
#define TORC_EXIT_RESTART
Definition:
torcexitcodes.h:5
torcxsdtest.h
TORC_EXIT_UNKOWN_ERROR
#define TORC_EXIT_UNKOWN_ERROR
Definition:
torcexitcodes.h:6
TorcXSDTest::RunXSDTestSuite
static int RunXSDTestSuite(TorcCommandLine *CommandLine)
Perform XSD test validation of XML files.
Definition:
torcxsdtest.cpp:90
TorcCommandLine::Database
Definition:
torccommandline.h:27
TorcCommandLine::LogFile
Definition:
torccommandline.h:28
main
int main(int argc, char **argv)
Definition:
server/main.cpp:28
TorcLocalContext::TearDown
static void TearDown(void)
Definition:
torclocalcontext.cpp:79
TORC_EXIT_OK
#define TORC_EXIT_OK
Definition:
torcexitcodes.h:4
TORC_REALM
#define TORC_REALM
Definition:
torclocaldefs.h:9
TORC_MAIN_THREAD
#define TORC_MAIN_THREAD
Definition:
torclocaldefs.h:10
TorcCommandLine::XSDTest
Definition:
torccommandline.h:29
torcexitcodes.h
torccommandline.h
torclocalcontext.h
Generated on Sat Jan 5 2019 21:54:03 for Torc by
1.8.11