Etterna
0.74.4
Loading...
Searching...
No Matches
src
RageUtil
File
RageFileDriverSlice.h
1
/* RageFileDriverSlice - Treat a portion of a file as a file. */
2
3
#ifndef RAGE_FILE_DRIVER_SLICE_H
4
#define RAGE_FILE_DRIVER_SLICE_H
5
6
#include "RageFileBasic.h"
7
8
class
RageFileDriverSlice
:
public
RageFileObj
9
{
10
public
:
11
/* pFile will be freed if DeleteFileWhenFinished is called. */
12
RageFileDriverSlice
(
RageFileBasic
* pFile,
int
iOffset,
int
iFileSize);
13
RageFileDriverSlice
(
const
RageFileDriverSlice
& cpy);
14
~RageFileDriverSlice
()
override
;
15
RageFileDriverSlice
* Copy()
const override
;
16
17
void
DeleteFileWhenFinished() { m_bFileOwned =
true
; }
18
19
int
ReadInternal(
void
* pBuffer,
size_t
iBytes)
override
;
20
int
WriteInternal(
const
void
*
/* pBuffer */
,
size_t
/* iBytes */
)
override
21
{
22
SetError(
"Not implemented"
);
23
return
-1;
24
}
25
int
SeekInternal(
int
iOffset)
override
;
26
int
GetFileSize()
const override
{
return
m_iFileSize; }
27
int
GetFD()
override
{
return
m_pFile->GetFD(); }
28
29
private
:
30
RageFileBasic
* m_pFile;
31
int
m_iFilePos;
32
int
m_iOffset, m_iFileSize;
33
bool
m_bFileOwned;
34
};
35
36
#endif
RageFileBasic
Definition
RageFileBasic.h:10
RageFileDriverSlice
Definition
RageFileDriverSlice.h:9
RageFileObj
Definition
RageFileBasic.h:66
Generated by
1.9.8