Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6file.h
Go to the documentation of this file.
1 
9 #ifndef P6FILE_H__
10 #define P6FILE_H__ 1
11 
12 #include "p6filetypes.h"
13 #include "p6datastream.h"
14 
15 namespace P6R {
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
37 {
38  P6COMMETHOD initialize() = 0;
39 
51  P6COMMETHOD getID(P6R::P6SIZE *pID) = 0;
52 
85  P6COMMETHOD open(const P6R::P6WCHAR *pwszFilename,P6R::P6FILEFLAGS fFlags,P6R::P6FILEMODE perms) = 0;
86 
106  P6COMMETHOD read(P6R::P6VOID *pBuffer,P6R::P6SIZE cBytesToRead,P6R::P6SIZE *pcBytesRead) = 0;
107 
128  P6COMMETHOD write(const P6R::P6VOID *pBuffer,P6R::P6SIZE cBytesToWrite,P6R::P6SIZE *pcBytesWritten) = 0;
129 
160  P6COMMETHOD writeFormatted(const P6R::P6CHAR *pFmt,P6R::P6ARG *pArgs,P6R::P6UINT32 cArgs,P6R::P6SIZE *pcBytesWritten) = 0;
161 
180  P6COMMETHOD seek(P6R::P6FILESEEK fromWhere,P6R::P6INT64 offset) = 0;
181 
194  P6COMMETHOD stat(P6R::P6FILEINFO *pInfo) = 0;
195 
204  P6COMMETHOD close() = 0;
205 };
206 
207 // {8E3A9F05-7A8E-440F-9FB9-EBC9CCDE129E}
208 #define IF_p6IUnbufferedFile {0x8E3A9F05,0x7A8E,0x440F,{0x9F,0xB9,0xEB,0xC9,0xCC,0xDE,0x12,0x9E}}
209 
210 // {0EECD54D-12D3-4DF8-8EE8-EE118718B2E2}
211 #define COMP_p6UnbufferedFile {0x0EECD54D,0x12D3,0x4DF8,{0x8E,0xE8,0xEE,0x11,0x87,0x18,0xB2,0xE2}}
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 
217 } // namespace
218 
219 #endif
220 
size_t P6SIZE
Definition: p6types.h:62
P6LONGLONG P6INT64
Definition: p6types.h:50
virtual P6R::P6ERR close()=0
Closes the open file causing any pending data to be flushed to disk.
virtual P6R::P6ERR stat(P6R::P6FILEINFO *pInfo)=0
Retrieves information about the currently open file.
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR write(const P6R::P6VOID *pBuffer, P6R::P6SIZE cBytesToWrite, P6R::P6SIZE *pcBytesWritten)=0
Writes data to the file begining at the current file position.
virtual P6R::P6ERR getID(P6R::P6SIZE *pID)=0
Retrieves an ID that can be used to identify this file.
virtual P6R::P6ERR read(P6R::P6VOID *pBuffer, P6R::P6SIZE cBytesToRead, P6R::P6SIZE *pcBytesRead)=0
Read data from the opened file starting at the current file pointer position.
p6IDataStream interface definitions
File and directory type definitions.
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
virtual P6R::P6ERR writeFormatted(const P6R::P6CHAR *pFmt, P6R::P6ARG *pArgs, P6R::P6UINT32 cArgs, P6R::P6SIZE *pcBytesWritten)=0
Writes formatted data to the file begining at the current file position.
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
P6R::P6UINT32 P6FILESEEK
Definition: p6filetypes.h:61
Provides ability to create, open, read, write and seek files.
Definition: p6file.h:36
P6R::P6UINT32 P6FILEFLAGS
File access flags are passed to various file open/create calls to specify the type of access that is ...
Definition: p6filetypes.h:40
#define P6COMMETHOD
Definition: p6types.h:872
virtual P6R::P6ERR seek(P6R::P6FILESEEK fromWhere, P6R::P6INT64 offset)=0
Moves the file pointer of the open file.
P6UINT32 P6FILEMODE
Definition: p6filetypes.h:74
Used to describe an open file.
Definition: p6filetypes.h:170
virtual P6R::P6ERR open(const P6R::P6WCHAR *pwszFilename, P6R::P6FILEFLAGS fFlags, P6R::P6FILEMODE perms)=0
Creates or opens the specified file using the the supplied flags and permissions. ...
virtual P6R::P6ERR initialize()=0
void P6VOID
Definition: p6types.h:75
Argument definition.
Definition: p6types.h:504
char P6CHAR
Narrow character type.
Definition: p6types.h:71