#include <camnet.h>
Public Types | |
enum | Priority { PRIORITY_OTHER = 0, PRIORITY_FONT_FILE, PRIORITY_CLIPART_FILE, PRIORITY_FILL_FILE, PRIORITY_CLIPART_THUMBNAIL, PRIORITY_FONT_THUMBNAIL, PRIORITY_FILL_THUMBNAIL, PRIORITY_OLD_CATALOG_FILE, PRIORITY_CURRENT_CATALOG_FILE } |
Public Member Functions | |
CacheEntry () | |
CacheEntry (const String_256 &strPath) | |
| |
BOOL | IsValid () |
INT32 | Size () const |
INT32 | GetPriority () const |
BOOL | IsFolder () |
BOOL | IsFile () |
BOOL | operator!= (const CacheEntry &entry) |
Public Attributes | |
_tstat | m_FileStat |
TCHAR | szFilePath [_MAX_PATH] |
BOOL | m_bIsValid |
Priority | m_nPriority |
Definition at line 417 of file camnet.h.
|
Definition at line 420 of file camnet.h. 00420 {PRIORITY_OTHER = 0, PRIORITY_FONT_FILE, PRIORITY_CLIPART_FILE, PRIORITY_FILL_FILE, 00421 PRIORITY_CLIPART_THUMBNAIL, PRIORITY_FONT_THUMBNAIL, PRIORITY_FILL_THUMBNAIL, 00422 PRIORITY_OLD_CATALOG_FILE, PRIORITY_CURRENT_CATALOG_FILE};
|
|
Definition at line 427 of file camnet.h. 00427 {memset(szFilePath, 0x00, sizeof(szFilePath)); m_bIsValid = FALSE;}
|
|
Definition at line 1952 of file camnet.cpp. 01953 { 01954 camStrcpy(szFilePath, strPath); 01955 if (m_bIsValid = (!_tstat(szFilePath, &m_FileStat))) 01956 { 01957 String_256 strFilePath(strPath); 01958 strFilePath.toLower(); 01959 PathName filePath(strFilePath); 01960 if (filePath.GetType() == _T("txt")) 01961 m_nPriority = PRIORITY_CURRENT_CATALOG_FILE; 01962 else if (filePath.GetType() == _T("old")) 01963 m_nPriority = PRIORITY_OLD_CATALOG_FILE; 01964 else 01965 { 01966 //find out if the file is in a clipart, font or fill folder 01967 INT32 rgTypes[5] = {SGLib_ClipArt, SGLib_Font, SGLib_Fractal, SGLib_ClipArt_WebThemes, SGLib_Blank}; 01968 INT32 nLibType; 01969 String_256 strAppDataPath; 01970 GetAppDataPath(&strAppDataPath); 01971 PathName appDataPath(strAppDataPath); 01972 for (INT32 i = 0; i < 5; i++) 01973 { 01974 nLibType = rgTypes[i]; 01975 if (nLibType == SGLib_Blank) 01976 break; 01977 String_256 strCacheSubdir = GetStringField(rgTypes[i], _R(IDS_CACHEDIR)); 01978 String_256 strTypePath(appDataPath.GetLocation(TRUE)); // path of files of type rgTypes[i] 01979 strTypePath += strCacheSubdir; 01980 strTypePath.toLower(); 01981 if (camStrstr(strFilePath, strTypePath)) 01982 break; 01983 } 01984 // is the file a thumbnail? 01985 BOOL bIsThumb = (camStrstr(strFilePath, _T("xarainfo"))) && (filePath.GetType() == _T("png")); 01986 switch (nLibType) 01987 { 01988 case SGLib_ClipArt: 01989 case SGLib_ClipArt_WebThemes: 01990 m_nPriority = bIsThumb ? PRIORITY_CLIPART_THUMBNAIL : PRIORITY_CLIPART_FILE; 01991 break; 01992 case SGLib_Font: 01993 m_nPriority = bIsThumb ? PRIORITY_FONT_THUMBNAIL : PRIORITY_FONT_FILE; 01994 break; 01995 case SGLib_Fractal: 01996 m_nPriority = bIsThumb ? PRIORITY_FILL_THUMBNAIL : PRIORITY_FILL_FILE; 01997 break; 01998 default: 01999 m_nPriority = PRIORITY_OTHER; 02000 } 02001 } 02002 } 02003 }
|
|
Definition at line 431 of file camnet.h. 00431 {return m_nPriority;}
|
|
Definition at line 433 of file camnet.h. 00433 {return m_bIsValid ? m_FileStat.st_mode & _S_IFREG : FALSE;}
|
|
Definition at line 432 of file camnet.h. 00432 {return m_bIsValid ? m_FileStat.st_mode & _S_IFDIR : FALSE;}
|
|
Definition at line 429 of file camnet.h. 00429 {return m_bIsValid;}
|
|
Definition at line 434 of file camnet.h. 00434 { return _tcsicmp(szFilePath, entry.szFilePath);}
|
|
Definition at line 430 of file camnet.h. 00430 {return m_FileStat.st_size;}
|
|
|
|
|
|
|
|
|