File: main.cpp

package info (click to toggle)
chessx 1.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,932 kB
  • sloc: cpp: 77,807; xml: 40; sh: 24; makefile: 7
file content (29 lines) | stat: -rwxr-xr-x 740 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <QCoreApplication>
#include <QTemporaryDir>

#include "output.h"
#include "memorydatabase.h"
#include "settings.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    AppSettings = new Settings("pgn-convert.settings");

    if (argc >= 2)
    {
        PgnDatabase db;
        QString filename = argv[1];
        QFileInfo fi(filename);
        QString outfile = fi.baseName() + ".processed.pgn";
        if (db.open(filename, true) && db.parseFile())
        {
            qDebug() << "Processing" << db.count() << "games in file" << filename;
            Output output(Output::Pgn);
            output.output(outfile, db);
            qDebug() << "Done";
        }
        return 0;
    }
    return 1;
}