-
Notifications
You must be signed in to change notification settings - Fork 0
/
xfl.h
executable file
·78 lines (70 loc) · 2.2 KB
/
xfl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/////////////////////////////////////////////////
// Find-File-Descriptor
ClassTP(TFFileDesc, PFFileDesc)//{
public:
#ifdef GLib_WIN
WIN32_FIND_DATA FDesc;
HANDLE FFileH;
#else
DIR* FDesc;
dirent* DirEnt;
#endif
public:
TFFileDesc();
static PFFileDesc New(){return PFFileDesc(new TFFileDesc());}
~TFFileDesc();
TFFileDesc(TSIn&){Fail;}
static PFFileDesc Load(TSIn& SIn){return new TFFileDesc(SIn);}
void Save(TSOut&){Fail;}
TFFileDesc& operator=(const TFFileDesc&){Fail; return *this;}
TStr GetFBase() const;
bool IsDir() const;
};
/////////////////////////////////////////////////
// Find-File
ClassTP(TFFile, PFFile)//{
private:
TStrV FPathV, FExtV;
TStr FBaseWc;
bool CsImpP;
bool RecurseP;
int FPathN;
PFFileDesc FFileDesc;
PFFile SubFFile;
TStr CurFNm;
int CurFNmN;
UndefDefaultCopyAssign(TFFile);
public:
TFFile(const TStr& _FNmWc, const bool& _RecurseP=false);
TFFile(const TStr& _FPath, const TStr& _FExt, const bool& _RecurseP=false);
TFFile(const TStrV& _FPathV, const TStrV& _FExtV,
const TStr& _FBaseWc, const bool& _RecurseP);
static PFFile New(const TStr& FNmWc, const bool& RecurseP){
return PFFile(new TFFile(FNmWc, RecurseP));}
static PFFile New(const TStrV& FPathV, const TStrV& FExtV,
const TStr FBaseWc, const bool& RecurseP){
return PFFile(new TFFile(FPathV, FExtV, FBaseWc, RecurseP));}
static PFFile New(const TStr& FPath, const TStr& FExt, const bool& RecurseP){
return PFFile(new TFFile(FPath, FExt, RecurseP));}
~TFFile();
TFFile(TSIn&){Fail;}
static PFFile Load(TSIn& SIn){return new TFFile(SIn);}
void Save(TSOut&){Fail;}
bool Next(TStr& FNm);
bool Next(){TStr FNm; return Next(FNm);}
TStr GetFNm() const {return CurFNm;}
int GetFNmN() const {return CurFNmN;}
static void GetFNmV(
const TStr& FPath, const TStrV& FExtV, const bool& RecurseP, TStrV& FNmV);
bool IsDir() const {
return FFileDesc->IsDir();}
};
/////////////////////////////////////////////////
// Directories
class TDir{
public:
static TStr GetCurDir();
static TStr GetExeDir();
static bool GenDir(const TStr& FPathFNm);
static bool DelDir(const TStr& FPathFNm);
};