Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

ThumbCache.h

Go to the documentation of this file.
00001 //
00002 // ThumbCache.h
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 // Construction
00041 public:
00042         CThumbCache();
00043         virtual ~CThumbCache();
00044 
00045 // Attributes
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 // Operations
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_)

Generated on Thu Dec 15 10:39:50 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2