CMS 3D CMS Logo

7zFile.h
Go to the documentation of this file.
1 /* 7zFile.h -- File IO
2 2009-11-24 : Igor Pavlov : Public domain */
3 
4 #ifndef __7Z_FILE_H
5 #define __7Z_FILE_H
6 
7 #ifdef _WIN32
8 #define USE_WINDOWS_FILE
9 #endif
10 
11 #ifdef USE_WINDOWS_FILE
12 #include <windows.h>
13 #else
14 #include <cstdio>
15 #endif
16 
17 #include "Types.h"
18 
20 
21 /* ---------- File ---------- */
22 
23 typedef struct {
24 #ifdef USE_WINDOWS_FILE
25  HANDLE handle;
26 #else
27  FILE *file;
28 #endif
29 } CSzFile;
30 
31 void File_Construct(CSzFile *p);
32 #if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
33 WRes InFile_Open(CSzFile *p, const char *name);
34 WRes OutFile_Open(CSzFile *p, const char *name);
35 #endif
36 #ifdef USE_WINDOWS_FILE
37 WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
38 WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
39 #endif
41 
42 /* reads max(*size, remain file's size) bytes */
43 WRes File_Read(CSzFile *p, void *data, size_t *size);
44 
45 /* writes *size bytes */
46 WRes File_Write(CSzFile *p, const void *data, size_t *size);
47 
48 WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
50 
51 /* ---------- FileInStream ---------- */
52 
53 typedef struct {
57 
59 
60 typedef struct {
64 
66 
67 typedef struct {
71 
73 
75 
76 #endif
CFileSeqInStream::file
CSzFile file
Definition: 7zFile.h:55
FileOutStream_CreateVTable
void FileOutStream_CreateVTable(CFileOutStream *p)
Definition: 7zFile.cc:270
ISeqOutStream
Definition: Types.h:149
EXTERN_C_BEGIN
#define EXTERN_C_BEGIN
Definition: Types.h:18
WRes
int WRes
Definition: Types.h:48
FileInStream_CreateVTable
void FileInStream_CreateVTable(CFileInStream *p)
Definition: 7zFile.cc:257
EXTERN_C_END
#define EXTERN_C_END
Definition: Types.h:19
patZpeak.handle
handle
Definition: patZpeak.py:23
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
UInt64
unsigned long long int UInt64
Definition: Types.h:88
CFileInStream::s
ISeekInStream s
Definition: 7zFile.h:61
File_Seek
WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
Definition: 7zFile.cc:159
File_Write
WRes File_Write(CSzFile *p, const void *data, size_t *size)
Definition: 7zFile.cc:127
ESzSeek
ESzSeek
Definition: Types.h:155
ISeqInStream
Definition: Types.h:138
CSzFile::file
FILE * file
Definition: 7zFile.h:27
Int64
long long int Int64
Definition: Types.h:87
OutFile_Open
WRes OutFile_Open(CSzFile *p, const char *name)
Definition: 7zFile.cc:59
InFile_Open
WRes InFile_Open(CSzFile *p, const char *name)
Definition: 7zFile.cc:58
CFileInStream
Definition: 7zFile.h:60
FileSeqInStream_CreateVTable
void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
Definition: 7zFile.cc:243
CFileOutStream::s
ISeqOutStream s
Definition: 7zFile.h:68
File_GetLength
WRes File_GetLength(CSzFile *p, UInt64 *length)
Definition: 7zFile.cc:212
CFileOutStream::file
CSzFile file
Definition: 7zFile.h:69
CFileSeqInStream
Definition: 7zFile.h:53
CFileSeqInStream::s
ISeqInStream s
Definition: 7zFile.h:54
File_Construct
void File_Construct(CSzFile *p)
Definition: 7zFile.cc:28
ISeekInStream
Definition: Types.h:157
File_Read
WRes File_Read(CSzFile *p, void *data, size_t *size)
Definition: 7zFile.cc:95
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
Types.h
CFileOutStream
Definition: 7zFile.h:67
File_Close
WRes File_Close(CSzFile *p)
Definition: 7zFile.cc:77
CFileInStream::file
CSzFile file
Definition: 7zFile.h:62
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
CSzFile
Definition: 7zFile.h:23