53 lines
1.5 KiB
C
53 lines
1.5 KiB
C
|
|
/**
|
|||
|
|
* 保存识别结果csv文件
|
|||
|
|
* */
|
|||
|
|
|
|||
|
|
#ifndef DELEXPIREDENGINE_H
|
|||
|
|
#define DELEXPIREDENGINE_H
|
|||
|
|
|
|||
|
|
#include "AppCommon.h"
|
|||
|
|
|
|||
|
|
#include "EngineBase.h"
|
|||
|
|
#include "EngineFactory.h"
|
|||
|
|
|
|||
|
|
#include "Config.h"
|
|||
|
|
#include "TimeUtil.h"
|
|||
|
|
#include "FileUtil.h"
|
|||
|
|
#include "StringUtil.h"
|
|||
|
|
|
|||
|
|
class DelExpiredEngine : public ai_matrix::EngineBase
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
DelExpiredEngine();
|
|||
|
|
~DelExpiredEngine();
|
|||
|
|
|
|||
|
|
APP_ERROR Init() override;
|
|||
|
|
APP_ERROR DeInit() override;
|
|||
|
|
APP_ERROR Process() override;
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
// 获取子目录列表
|
|||
|
|
void getSubfolderNames(std::string &directory, std::vector<Date> &folder_names);
|
|||
|
|
// 获取某月有多少天
|
|||
|
|
int DaysInMonth(int year, int month);
|
|||
|
|
// 解析字符串为日期结构体
|
|||
|
|
Date StrToDate(const std::string &date_str);
|
|||
|
|
// 减去指定天数
|
|||
|
|
void SubtractDays(Date &date, int n_days);
|
|||
|
|
// 格式化日期结构体为字符串
|
|||
|
|
std::string DateToStr(const Date &date);
|
|||
|
|
// 接收一个日期字符串和一个整数n,返回n天前的日期字符串
|
|||
|
|
std::string getDateBeforeNDays(const std::string &input_date, int n_days);
|
|||
|
|
void DeleteFolder(const std::string directory);
|
|||
|
|
// 删除向量中小于指定日期的所有元素
|
|||
|
|
void DeleteEarlierDatesFolder(std::string &path, std::vector<Date> &subfolders, const Date &reference_date);
|
|||
|
|
void DeletePreviousFolder(std::string path, const std::string &date, int n_days);
|
|||
|
|
|
|||
|
|
std::string strPort0_;
|
|||
|
|
|
|||
|
|
ai_matrix::BaseConfig baseConfig_;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
ENGINE_REGIST(DelExpiredEngine)
|
|||
|
|
|
|||
|
|
#endif
|