00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_THUMBCACHE_H__EDC6DF1A_071C_4171_A709_C7CCD7FAE56A__INCLUDED_)
00023 #define AFX_THUMBCACHE_H__EDC6DF1A_071C_4171_A709_C7CCD7FAE56A__INCLUDED_
00024
00025 #pragma once
00026
00027 class CImageFile;
00028
00029 typedef struct
00030 {
00031 DWORD nIndex;
00032 DWORD nOffset;
00033 DWORD nLength;
00034 FILETIME pTime;
00035 } THUMB_INDEX;
00036
00037
00038 class CThumbCache
00039 {
00040
00041 public:
00042 CThumbCache();
00043 virtual ~CThumbCache();
00044
00045
00046 protected:
00047 CCriticalSection m_pSection;
00048 protected:
00049 CString m_sPath;
00050 CFile m_pFile;
00051 BOOL m_bOpen;
00052 CSize m_szThumb;
00053 protected:
00054 DWORD m_nOffset;
00055 THUMB_INDEX* m_pIndex;
00056 DWORD m_nIndex;
00057 DWORD m_nBuffer;
00058
00059
00060 public:
00061 BOOL Load(LPCTSTR pszPath, CSize* pszThumb, DWORD nIndex, CImageFile* pImage);
00062 BOOL Store(LPCTSTR pszPath, CSize* pszThumb, DWORD nIndex, CImageFile* pImage);
00063 void Close();
00064 protected:
00065 BOOL Prepare(LPCTSTR pszPath, CSize* pszThumb, BOOL bCreate);
00066 BOOL GetFileTime(LPCTSTR pszPath, FILETIME* pTime);
00067 public:
00068 static BOOL Purge(LPCTSTR pszPath);
00069
00070 };
00071
00072 #endif // !defined(AFX_THUMBCACHE_H__EDC6DF1A_071C_4171_A709_C7CCD7FAE56A__INCLUDED_)