You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- /**
- * File: ImageInfoDb.h
- * Purpose: provide API that can access the image_info in sqlite file
- * Author: zhushengming@navinfo.com
- * Date: 2023/10/22
- * All right reserved (c) SWWX Co.Ltd. 2023
- */
-
- #ifndef DATAMANAER_DATABASE_IMAGEINFODB_H_
- #define DATAMANAER_DATABASE_IMAGEINFODB_H_
-
- #include <QString>
- #include <QStringList>
- #include <QSqlDatabase>
- #include <QSqlError>
- #include <QSqlQuery>
- #include <QSqlTableModel>
- #include <QSqlRecord>
- #include <QCoreApplication>
- #include <QDateTime>
-
- #include <string>
- #include <vector>
-
- #include "DataManager/Common/Image.h"
-
- class ImageInfoDb {
- public:
- ImageInfoDb();
- ~ImageInfoDb();
-
- public:
- bool open(QString dbPath);
- void close();
-
- // 获取所有的Image图像
- std::vector<Image*> getAllImage();
-
- // 搜索符合条件的Image
- std::vector<Image*> searchImage(QDate startDate, QDate endDate, std::string type);
-
- // 通过下标和内容获取Image对象
- Image* getImageByDate(const QString& imageDate);
- Image* getImageByName(const QString& fileName);
- Image* getImageByIndex(int index);
-
- // 判断Image是否存在在数据库中
- bool isExists(Image* image);
- bool isExists(std::string date);
-
- // 保存到数据库
- void saveImage(Image* image);
-
- // 从数据库中删除
- void removeImage(std::string imageDate);
-
- // 清空数据库
- void clearImage();
-
- public:
- QSqlDatabase _imageDb;
- };
-
- #endif // DATAMANAER_DATABASE_IMAGEINFODB_H_
|