00001 /* 00002 * Copyright (C) Sergey P. Derevyago, 2003-2004. 00003 * 00004 * Permission to copy, use, modify, sell and distribute this software is granted 00005 * provided this copyright notice appears in all copies. 00006 * This software is provided "as is" without express or implied warranty, and 00007 * with no claim as to its suitability for any purpose. 00008 * 00009 */ 00010 00015 #ifndef __FINDFILE_HPP__ 00016 #define __FINDFILE_HPP__ 00017 00018 #include "cexception.hpp" 00019 00023 class FindFileCallback { 00024 public: 00032 virtual bool found(const std::string& fileName)=0; 00033 00037 virtual ~FindFileCallback() {} 00038 00039 private: 00041 FindFileCallback& operator=(const FindFileCallback&); 00042 }; 00043 00048 class FindFile { 00049 public: 00057 virtual bool find(const std::string& dir, bool recur, 00058 const std::string& mask, FindFileCallback& cb)=0; 00059 00063 virtual ~FindFile() {} 00064 00065 private: 00067 FindFile& operator=(const FindFile&); 00068 }; 00069 00073 namespace Factory { 00074 00079 sh_ptr<FindFile> newFindFile(); 00080 00081 } 00082 00083 #endif