1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- #ifndef __FFSCO__
- #define __FFSCO__
- #ifndef WIN32
- #error now only for WIN32(platform).
- #endif
- #include <string>
- #include <vector>
- #include <sstream>
- using namespace std;
- #pragma warning(disable:4786)
- #ifdef UNICODE
- typedef wstring tstring;
- #else
- typedef string tstring;
- #endif
- namespace helper_coffs {
- const int max_limit = 0x100000;
- const int def_limit = 0x10000;
- const TCHAR c_pathSeparator = _T('\\');
- const tstring s_pathSeparator = _T("\\");
-
- class ffsco
- {
- public:
- typedef vector<tstring> typeT;
- virtual int match(tstring fext_, tstring file_);
- public:
- void test();
- int find(tstring path_, tstring fext_ = _T(""));
- public:
- tstring get(int i = 0) { return _co.at(i); }
- int count() { return _co_dir.size() + _co_file.size(); }
-
- typeT co() { return _co; }
- typeT co_dir() { return _co_dir; }
- typeT co_file() { return _co_file; }
- public:
- int limit() { return _limit; }
- void limit(int limit_);
- public:
- int dirs() { return _dirs; }
- void dirs(int dirs) { _dirs = dirs; }
- int dir(tstring s);
- private:
- int _limit;
- int _dirs;
- typeT _co_file;
- typeT _co_dir;
- typeT _co;
- public:
- ffsco();
- virtual ~ffsco();
- private:
- inline int checkcount() { return count() == limit(); }
- inline tstring _uppercase_(tstring s);
- };
- };
- #endif
|