AeFile.h
1.57 KB
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
79
80
#ifndef _AE_FileMgr_h
#define _AE_FileMgr_h
#include "AeErr.h"
#include "AeAsset.h"
template<class T> class GList;
class AeAsset;
class AeAssetBase;
class AeFile
{
public:
AeFile (const char *);
virtual ~AeFile (void);
char * GetFullName (void) { return fFullName; }
char * GetFileName (void) { return fFileName; }
char * GetDirName (void) { return fDirName; }
void SetFullName (const char *);
void SwapTmpFile (const char *);
// these routines make useful strings. caller must deallocate memory.
char * MakeBackupName (void);
char * MakeFilePrefix (void);
char * MakeRelativePath (char * path);
virtual void ReportError (AeErr err);
protected:
void newNames (const char *);
void deleteNames (void);
AeErr copy (const char * from, const char * to);
AeErr getFileData (char * fname, char *& fData, int & fSize);
static void parseFileString (const char *, char *& dir,
char *& file, char *& suffix);
char * fFullName;
char * fDirName;
char * fFileName;
#ifndef NDEBUG
public:
static Boolean Test (void);
#endif
};
class AeAssetFile : public AeFile
{
public:
static AeAssetFile * NewAssetFile (char *);
AeAssetFile (char *);
virtual ~AeAssetFile (void);
virtual AeErr Read (AeAsset *&);
virtual AeErr ReadList (GList<AeAsset *> *&);
virtual AeErr Write (AeAssetBase *);
protected:
static TAssetType suffix2type (char *);
};
#endif