#pragma once class CGaugeRepo { public: struct RepoItem { RepoItem() : pPreviewImg(NULL) { } ~RepoItem() { SAFE_DELETE(pPreviewImg); } CString strPath; CString strRelativePath; CString strName; CString strTraitsPath; CString strInitTraitsPath; CString strStylePath; CString strPreviewPath; CXTPGraphicBitmapPng* pPreviewImg; }; ~CGaugeRepo(); BOOL Load(LPCTSTR pPath); INT_PTR GetCount() const; const RepoItem* GetItem(INT_PTR nIndex); static RepoItem* Find(LPCTSTR pPath, BOOL bLoadPreview = FALSE); private: CString m_strPath; CList m_items; RepoItem m_current; int m_nGauges; typedef void (WINAPI CGaugeRepo::*EnumFilesCallback)(LPCTSTR pPath); BOOL EnumFiles(BOOL bFiles, LPCTSTR pPath, EnumFilesCallback pCallback); void WINAPI ProcessTree(LPCTSTR pPath); void WINAPI ProcessGauges(LPCTSTR pPath); static CXTPGraphicBitmapPng* LoadPreview(LPCTSTR pPath); void Cleanup(); void DumpGaugeList(LPCTSTR pPath); };