00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #include "stdafx.h" 00007 #include "FdmApp.h" 00008 #include "vmsStringRecentList.h" 00009 00010 #ifdef _DEBUG 00011 #undef THIS_FILE 00012 static char THIS_FILE[]=__FILE__; 00013 #define new DEBUG_NEW 00014 #endif 00015 00016 vmsStringRecentList::vmsStringRecentList() 00017 { 00018 m_nMaxEntries = 10; 00019 } 00020 00021 vmsStringRecentList::~vmsStringRecentList() 00022 { 00023 00024 } 00025 00026 void vmsStringRecentList::Add(LPCSTR psz) 00027 { 00028 m_vList.Add (psz); 00029 00030 bool bNeedDel = true; 00031 00032 for (int i = 0; i < m_vList.get_Count () - 1; i++) 00033 { 00034 if (lstrcmp (m_vList.get_String (i), psz) == 0) 00035 { 00036 m_vList.Del (i); 00037 bNeedDel = false; 00038 break; 00039 } 00040 } 00041 00042 if (bNeedDel) 00043 { 00044 if (m_vList.get_Count () > m_nMaxEntries) 00045 m_vList.Del (0); 00046 } 00047 } 00048 00049 int vmsStringRecentList::get_Count() const 00050 { 00051 return m_vList.get_Count (); 00052 } 00053 00054 LPCSTR vmsStringRecentList::get_String(int nIndex) const 00055 { 00056 return m_vList.get_String (nIndex); 00057 } 00058 00059 void vmsStringRecentList::Clear() 00060 { 00061 m_vList.Clear (); 00062 } 00063 00064 BOOL vmsStringRecentList::Save(HANDLE hFile) 00065 { 00066 return m_vList.Save (hFile); 00067 } 00068 00069 BOOL vmsStringRecentList::Load(HANDLE hFile) 00070 { 00071 return m_vList.Load (hFile); 00072 }
1.5.6