File indexing completed on 2024-06-02 04:50:16

0001 #pragma once
0002 
0003 #include <QObject>
0004 #include <QSqlDatabase>
0005 #include "kdtree.hpp"
0006 
0007 class City;
0008 class CitiesDB : public QObject
0009 {
0010     Q_OBJECT
0011 
0012 public:
0013     explicit CitiesDB(QObject * =nullptr);
0014 
0015     City findCity(double latitude, double longitude);
0016     City city(const QString&);
0017     std::vector<point_t> cities();
0018     bool error() const;
0019 
0020 private:
0021     QSqlDatabase m_db;
0022     bool m_error = {true};
0023 
0024 };