Etterna
0.74.4
Loading...
Searching...
No Matches
src
RageUtil
File
RageFileDriver.h
1
/* RageFileDriver - File driver base classes. */
2
3
#ifndef RAGE_FILE_DRIVER_H
4
#define RAGE_FILE_DRIVER_H
5
6
#include "RageFileManager.h"
7
8
class
RageFileBasic
;
9
class
FilenameDB
;
10
11
class
RageFileDriver
12
{
13
public
:
14
RageFileDriver
(
FilenameDB
* pDB) { FDB = pDB; }
15
virtual
~RageFileDriver
();
16
virtual
RageFileBasic
* Open(
const
std::string& sPath,
17
int
iMode,
18
int
& iError) = 0;
19
virtual
void
GetDirListing(
const
std::string& sPath,
20
std::vector<std::string>& asAddTo,
21
DirListingReturnFilter returnFilter,
22
bool
bReturnPathToo);
23
virtual
RageFileManager::FileType GetFileType(
const
std::string& sPath);
24
virtual
int
GetFileSizeInBytes(
const
std::string& sFilePath);
25
virtual
int
GetFileHash(
const
std::string& sPath);
26
virtual
int
GetPathValue(
const
std::string& sPath);
27
virtual
void
FlushDirCache(
const
std::string& sPath);
28
virtual
void
CacheFile(
const
std::string&
/* sPath */
) {}
29
virtual
bool
Move(
const
std::string&
/* sOldPath */
,
30
const
std::string&
/* sNewPath */
)
31
{
32
return
false
;
33
}
34
virtual
bool
Remove(
const
std::string&
/* sPath */
) {
return
false
; }
35
36
/* Optional: Move to a different place, as if reconstructed with a different
37
* path. */
38
virtual
bool
Remount(
const
std::string&
/* sPath */
) {
return
false
; }
39
40
/* Possible error returns from Open, in addition to standard errno.h values:
41
*/
42
enum
43
{
44
ERROR_WRITING_NOT_SUPPORTED = -1
45
};
46
// protected:
47
FilenameDB
* FDB;
48
};
49
50
/* This is used to register the driver, so RageFileManager can see it. */
51
struct
FileDriverEntry
52
{
53
FileDriverEntry
(
const
std::string& sType);
54
virtual
~FileDriverEntry
();
55
virtual
RageFileDriver
* Create(
const
std::string& sRoot)
const
= 0;
56
57
std::string m_sType;
58
const
FileDriverEntry
* m_pLink;
59
};
60
RageFileDriver
*
61
MakeFileDriver(
const
std::string& Type,
const
std::string& Root);
62
63
#endif
FilenameDB
A container for a file listing.
Definition
RageUtil_FileDB.h:108
RageFileBasic
Definition
RageFileBasic.h:10
RageFileDriver
Definition
RageFileDriver.h:12
FileDriverEntry
Definition
RageFileDriver.h:52
Generated by
1.9.8