00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #if !defined(AFX_FSCMDHISTORYMGR_H__A0BE2A45_DC68_4ED6_9724_A64D2419D197__INCLUDED_) 00007 #define AFX_FSCMDHISTORYMGR_H__A0BE2A45_DC68_4ED6_9724_A64D2419D197__INCLUDED_ 00008 00009 #if _MSC_VER > 1000 00010 #pragma once 00011 #endif 00012 00013 #include "list.h" 00014 00015 #define HISTFILE_CURRENT_VERSION (1) 00016 00017 #define HISTFILE_SIG "FDM History" 00018 00019 struct fsHistFileHdr 00020 { 00021 char szSig [sizeof (HISTFILE_SIG) + 1]; 00022 WORD wVer; 00023 00024 fsHistFileHdr () 00025 { 00026 strcpy (szSig, HISTFILE_SIG); 00027 wVer = HISTFILE_CURRENT_VERSION; 00028 } 00029 }; 00030 00031 class fsCmdHistoryMgr 00032 { 00033 public: 00034 00035 void Set_MaxDaysCount (int cMax); 00036 00037 void Set_NoHistory (BOOL b); 00038 00039 void ClearHistory(); 00040 00041 void Set_MaxRecordCount (int iMax); 00042 00043 void AddRecord (LPCSTR pszRecord); 00044 00045 LPCSTR GetRecord (int iRec); 00046 00047 int GetRecordCount(); 00048 00049 BOOL SaveToFile (HANDLE hFile); 00050 00051 BOOL ReadFromFile (HANDLE hFile); 00052 00053 fsCmdHistoryMgr(); 00054 virtual ~fsCmdHistoryMgr(); 00055 00056 protected: 00057 00058 struct fs1DayRecords 00059 { 00060 FILETIME day; 00061 00062 fs::list <CString> vRecs; 00063 }; 00064 00065 fs::list <fs1DayRecords> m_vRecs; 00066 int m_cMaxRecords; 00067 SYSTEMTIME m_curday; 00068 BOOL m_bNoHistory; 00069 int m_cMaxDays; 00070 }; 00071 00072 #endif
1.5.6