21#ifndef PDFTOOLS_TOOLBOX_PTXSYS_H__
22#define PDFTOOLS_TOOLBOX_PTXSYS_H__
25#ifndef NO_FILE_STREAM_DESCRIPTOR
35#define PtxSys_PathStreamDescriptor_Create PtxSys_PathStreamDescriptor_CreateW
37#define PtxSys_PathStreamDescriptor_Create PtxSys_PathStreamDescriptor_CreateA
43typedef size_t(
STDCALL*
TRead)(
void* handle,
void* pData,
size_t nSize);
44typedef size_t(
STDCALL*
TWrite)(
void* handle,
const void* pData,
size_t nSize);
81#ifndef NO_FILE_STREAM_DESCRIPTOR
95 iPos = ftell((FILE*)handle);
98 if (fseek((FILE*)handle, 0L, SEEK_END) != 0)
100 nLen = ftell((FILE*)handle);
101 if (fseek((FILE*)handle, (
long)iPos, SEEK_SET) != 0)
115 return fseek((FILE*)handle, (
long)iPos, SEEK_SET) == 0 ? 1 : 0;
136 size_t nRead = fread(pData, 1, nSize, (FILE*)handle);
137 if (nRead != nSize && ferror((FILE*)handle) != 0)
152 if (fwrite(pData, 1, nSize, (FILE*)handle) != nSize)
Structure that groups a set of callbacks that model streams.
Definition PdfTools_Toolbox_PtxSys.h:49
TTell pfTell
Get current byte position.
Definition PdfTools_Toolbox_PtxSys.h:62
void * m_handle
Stream handle.
Definition PdfTools_Toolbox_PtxSys.h:78
TRelease pfRelease
Release handle.
Definition PdfTools_Toolbox_PtxSys.h:75
TGetLength pfGetLength
Get length of stream in bytes.
Definition PdfTools_Toolbox_PtxSys.h:51
TSeek pfSeek
Set position.
Definition PdfTools_Toolbox_PtxSys.h:57
TRead pfRead
Read nSize bytes from stream.
Definition PdfTools_Toolbox_PtxSys.h:67
TWrite pfWrite
Write nSize bytes to stream.
Definition PdfTools_Toolbox_PtxSys.h:72