marble
Go to the documentation of this file.
12 #include <QCoreApplication>
13 #include <QDataStream>
16 #include <QStringList>
18 int main(
int argc,
char *argv[])
22 qDebug(
" Syntax: pntdel [-i pnt-sourcefile -o pnt-targetfile -id idNumber] " );
24 QString inputFilename(
"PDIFFBORDERS.PNT");
26 if (inputIndex > 0 && inputIndex + 1 < argc )
27 inputFilename = app.
arguments().
at( inputIndex + 1 );
29 QString outputFilename(
"NEW.PNT");
31 if (outputIndex > 0 && outputIndex + 1 < argc )
32 outputFilename = app.
arguments().
at( outputIndex + 1 );
36 if (idIndex > 0 && idIndex + 1 < argc )
37 delIndex = app.
arguments().
at( idIndex + 1 ).toInt();
40 qDebug() <<
"input filename:" << inputFilename;
41 qDebug() <<
"output filename:" << outputFilename;
42 qDebug() <<
"remove index:" << delIndex;
45 QFile file( inputFilename );
47 if ( file.
open( QIODevice::ReadOnly ) ) {
52 QFile data(outputFilename);
54 if (data.
open(QFile::WriteOnly | QFile::Truncate)) {
64 while( !stream.
atEnd() ){
65 stream >> header >> iLat >> iLon;
66 if ( header == delIndex ) {
69 else if ( header > 5 )
73 out << header << iLat << iLon;
78 qDebug() <<
"ERROR: Couldn't write output file to disc!";
83 qDebug() <<
"ERROR: Source file not found!";
const T & at(int i) const
void exit(int returnCode)
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
void setByteOrder(ByteOrder bo)
int indexOf(const QRegExp &rx, int from) const
int main(int argc, char *argv[])
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.