#ifndef __CSAVERECOMMITSQL_H_ #define __CSAVERECOMMITSQL_H_ #ifdef _WINDOWS64 #ifdef SAVE_SQL_EXPORTS #define SAVE_SQL_API __declspec(dllexport) #else #define SAVE_SQL_API __declspec(dllimport) #endif #else #define SAVE_SQL_API #endif #include #include #include using namespace std; const string FILE_SEPARATOR = "\n_NARI_RE_COMMIT_\n"; const string IN_DIR_SEPARATOR = "/in/"; const string OUT_DIR_SEPARATOR = "/out/"; const int MAX_FILE_NAME_LENGTH = 255; const int R_HIGH_PRIOR = 1; const int R_MIDDLE_PRIOR = 2; const int R_LOW_PRIOR = 3; const int NO_SQL_DUP_RE_COMMIT = 0; const int SQL_DUP_RE_COMMIT = 1; const int RE_COMMIT_SAMPLE = 1; const int RE_COMMIT_SCADA = 2; const int RE_COMMIT_MODEL = 3; const int RE_COMMIT_STATICS = 4; #include "db_com/wholepubtools.h" #include "system.h" #include "db_commit_m.h" class SAVE_SQL_API CSaveReCommitSql { public: CSaveReCommitSql(); ~CSaveReCommitSql(); public: int SaveCommitSqlToFile(const vector & strCommitSqlVec , string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); int SaveSampleSqlToFile(const vector & strCommitSqlVec , string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); int SaveWarnSqlToFile(const vector & strCommitSqlVec , string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); int SaveModelSqlToFile(const vector & strCommitSqlVec , string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); int SaveStaticsSqlToFile(const vector & strCommitSqlVec , string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); int SaveBindStructToFile(const TCommitBindStru CommitBindStru, string strFileType , int nPrior , int nCommitType , int nDupType = SQL_DUP_RE_COMMIT ); private: int m_nFileNo; int m_LastSaveReCommitSqlTime; string m_strInPathName; string m_strOutPathName; string m_strInPathNameBind; string m_strOutPathNameBind; int MoveInFileToOutFile(const string strInFileName); int GetOutFileName(const string strInFileName , string &strOutFileName); private: int GetPathName(); }; #endif