This file is indexed.

/usr/include/qgis/qgsosmimport.h is in libqgis-dev 2.0.1-2build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/***************************************************************************
  qgsosmimport.h
  --------------------------------------
  Date                 : January 2013
  Copyright            : (C) 2013 by Martin Dobias
  Email                : wonder dot sk at gmail dot com
 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef OSMIMPORT_H
#define OSMIMPORT_H

#include <QFile>
#include <QObject>

#include "qgsosmbase.h"

class QXmlStreamReader;

/**
 * @brief The QgsOSMXmlImport class imports OpenStreetMap XML format to our topological representation
 * in a SQLite database (see QgsOSMDatabase for details).
 *
 * How to use the classs:
 * 1. set input XML file name and output DB file name (in constructor or with respective functions)
 * 2. run import()
 * 3. check errorString() if the import failed
 */
class ANALYSIS_EXPORT QgsOSMXmlImport : public QObject
{
    Q_OBJECT
  public:
    explicit QgsOSMXmlImport( const QString& xmlFileName = QString(), const QString& dbFileName = QString() );

    void setInputXmlFileName( const QString& xmlFileName ) { mXmlFileName = xmlFileName; }
    QString inputXmlFileName() const { return mXmlFileName; }

    void setOutputDbFileName( const QString& dbFileName ) { mDbFileName = dbFileName; }
    QString outputDbFileName() const { return mDbFileName; }

    /**
     * Run import. This will parse the XML file and store the data in a SQLite database.
     * @return true on success, false when import failed (see errorString() for the error)
     */
    bool import();

    bool hasError() const { return !mError.isEmpty(); }
    QString errorString() const { return mError; }

  signals:
    void progress( int percent );

  protected:

    bool createDatabase();
    bool closeDatabase();
    void deleteStatement( sqlite3_stmt*& stmt );

    bool createIndexes();

    void readRoot( QXmlStreamReader& xml );
    void readNode( QXmlStreamReader& xml );
    void readWay( QXmlStreamReader& xml );
    void readTag( bool way, QgsOSMId id, QXmlStreamReader& xml );

  private:
    QString mXmlFileName;
    QString mDbFileName;

    QString mError;

    QFile mInputFile;

    sqlite3* mDatabase;
    sqlite3_stmt* mStmtInsertNode;
    sqlite3_stmt* mStmtInsertNodeTag;
    sqlite3_stmt* mStmtInsertWay;
    sqlite3_stmt* mStmtInsertWayNode;
    sqlite3_stmt* mStmtInsertWayTag;
};



#endif // OSMIMPORT_H