16#ifndef PDFTOOLBOX_PTXSYS_H__
17#define PDFTOOLBOX_PTXSYS_H__
20#ifndef NO_FILE_STREAM_DESCRIPTOR
30#define PtxSys_PathStreamDescriptor_Create PtxSys_PathStreamDescriptor_CreateW
32#define PtxSys_PathStreamDescriptor_Create PtxSys_PathStreamDescriptor_CreateA
38typedef size_t(
STDCALL*
TRead)(
void* handle,
void* pData,
size_t nSize);
39typedef size_t(
STDCALL*
TWrite)(
void* handle,
const void* pData,
size_t nSize);
76#ifndef NO_FILE_STREAM_DESCRIPTOR
90 iPos = ftell((FILE*)handle);
93 if (fseek((FILE*)handle, 0L, SEEK_END) != 0)
95 nLen = ftell((FILE*)handle);
96 if (fseek((FILE*)handle, (
long)iPos, SEEK_SET) != 0)
110 return fseek((FILE*)handle, (
long)iPos, SEEK_SET) == 0 ? 1 : 0;
131 size_t nRead = fread(pData, 1, nSize, (FILE*)handle);
132 if (nRead != nSize && ferror((FILE*)handle) != 0)
147 if (fwrite(pData, 1, nSize, (FILE*)handle) != nSize)
192 const char* szPath,
BOOL bIsReadOnly);
234 void* pData,
size_t nSize);
236 const void* pData,
size_t nSize);
Structure that groups a set of callbacks that model streams.
Definition PdfToolbox_PtxSys.h:44
TTell pfTell
Get current byte position.
Definition PdfToolbox_PtxSys.h:57
void * m_handle
Stream handle.
Definition PdfToolbox_PtxSys.h:73
TRelease pfRelease
Release handle.
Definition PdfToolbox_PtxSys.h:70
TGetLength pfGetLength
Get length of stream in bytes.
Definition PdfToolbox_PtxSys.h:46
TSeek pfSeek
Set position.
Definition PdfToolbox_PtxSys.h:52
TRead pfRead
Read nSize bytes from stream.
Definition PdfToolbox_PtxSys.h:62
TWrite pfWrite
Write nSize bytes to stream.
Definition PdfToolbox_PtxSys.h:67