TrinityCore
|
Go to the source code of this file.
Classes | |
struct | _PART_FILE_HEADER |
struct | _PART_FILE_MAP_ENTRY |
struct | _FILE_BITMAP_FOOTER |
union | TBaseProviderData |
struct | TFileStream |
struct | TBlockStream |
struct | TEncryptedStream |
Macros | |
#define | ID_FILE_BITMAP_FOOTER 0x33767470 |
#define | DEFAULT_BLOCK_SIZE 0x00004000 |
#define | DEFAULT_BUILD_NUMBER 10958 |
#define | ENCRYPTED_CHUNK_SIZE 0x40 |
Typedefs | |
typedef void(* | STREAM_INIT )(struct TFileStream *pStream) |
typedef bool(* | STREAM_CREATE )(struct TFileStream *pStream) |
typedef bool(* | STREAM_OPEN )(struct TFileStream *pStream, const TCHAR *szFileName, DWORD dwStreamFlags) |
typedef bool(* | STREAM_READ )(struct TFileStream *pStream, ULONGLONG *pByteOffset, void *pvBuffer, DWORD dwBytesToRead) |
typedef bool(* | STREAM_WRITE )(struct TFileStream *pStream, ULONGLONG *pByteOffset, const void *pvBuffer, DWORD dwBytesToWrite) |
typedef bool(* | STREAM_RESIZE )(struct TFileStream *pStream, ULONGLONG FileSize) |
typedef bool(* | STREAM_GETSIZE )(struct TFileStream *pStream, ULONGLONG *pFileSize) |
typedef bool(* | STREAM_GETPOS )(struct TFileStream *pStream, ULONGLONG *pByteOffset) |
typedef void(* | STREAM_CLOSE )(struct TFileStream *pStream) |
typedef bool(* | BLOCK_READ )(struct TFileStream *pStream, ULONGLONG StartOffset, ULONGLONG EndOffset, LPBYTE BlockBuffer, DWORD BytesNeeded, bool bAvailable) |
typedef bool(* | BLOCK_CHECK )(struct TFileStream *pStream, ULONGLONG BlockOffset) |
typedef void(* | BLOCK_SAVEMAP )(struct TFileStream *pStream) |
typedef struct _PART_FILE_HEADER | PART_FILE_HEADER |
typedef struct _PART_FILE_HEADER * | PPART_FILE_HEADER |
typedef struct _PART_FILE_MAP_ENTRY | PART_FILE_MAP_ENTRY |
typedef struct _PART_FILE_MAP_ENTRY * | PPART_FILE_MAP_ENTRY |
typedef struct _FILE_BITMAP_FOOTER | FILE_BITMAP_FOOTER |
typedef struct _FILE_BITMAP_FOOTER * | PFILE_BITMAP_FOOTER |
#define DEFAULT_BLOCK_SIZE 0x00004000 |
#define DEFAULT_BUILD_NUMBER 10958 |
#define ENCRYPTED_CHUNK_SIZE 0x40 |
#define ID_FILE_BITMAP_FOOTER 0x33767470 |
typedef bool(* BLOCK_CHECK)(struct TFileStream *pStream,ULONGLONG BlockOffset) |
typedef bool(* BLOCK_READ)(struct TFileStream *pStream,ULONGLONG StartOffset,ULONGLONG EndOffset,LPBYTE BlockBuffer,DWORD BytesNeeded,bool bAvailable) |
typedef void(* BLOCK_SAVEMAP)(struct TFileStream *pStream) |
typedef struct _FILE_BITMAP_FOOTER FILE_BITMAP_FOOTER |
typedef struct _PART_FILE_HEADER PART_FILE_HEADER |
typedef struct _PART_FILE_MAP_ENTRY PART_FILE_MAP_ENTRY |
typedef struct _FILE_BITMAP_FOOTER * PFILE_BITMAP_FOOTER |
typedef struct _PART_FILE_HEADER * PPART_FILE_HEADER |
typedef struct _PART_FILE_MAP_ENTRY * PPART_FILE_MAP_ENTRY |
typedef void(* STREAM_CLOSE)(struct TFileStream *pStream) |
typedef bool(* STREAM_CREATE)(struct TFileStream *pStream) |
typedef bool(* STREAM_GETPOS)(struct TFileStream *pStream,ULONGLONG *pByteOffset) |
typedef bool(* STREAM_GETSIZE)(struct TFileStream *pStream,ULONGLONG *pFileSize) |
typedef void(* STREAM_INIT)(struct TFileStream *pStream) |
typedef bool(* STREAM_OPEN)(struct TFileStream *pStream,const TCHAR *szFileName,DWORD dwStreamFlags) |
typedef bool(* STREAM_READ)(struct TFileStream *pStream,ULONGLONG *pByteOffset,void *pvBuffer,DWORD dwBytesToRead) |
typedef bool(* STREAM_RESIZE)(struct TFileStream *pStream,ULONGLONG FileSize) |
typedef bool(* STREAM_WRITE)(struct TFileStream *pStream,ULONGLONG *pByteOffset,const void *pvBuffer,DWORD dwBytesToWrite) |
void FileStream_Close | ( | TFileStream * | pStream | ) |
This function closes an archive file and frees any data buffers that have been allocated for stream management. The function must also support partially allocated structure, i.e. one or more buffers can be NULL, if there was an allocation failure during the process
pStream Pointer to an open stream
TFileStream* FileStream_CreateFile | ( | const TCHAR * | szFileName, |
DWORD | dwStreamFlags | ||
) |
This function creates a new file for read-write access
szFileName Name of the file to create
const TCHAR* FileStream_GetFileName | ( | TFileStream * | pStream | ) |
Returns the file name of the stream
pStream Pointer to an open stream
bool FileStream_GetFlags | ( | TFileStream * | pStream, |
PDWORD | pdwStreamFlags | ||
) |
Returns the stream flags
pStream Pointer to an open stream pdwStreamFlags Pointer where to store the stream flags
bool FileStream_GetPos | ( | TFileStream * | pStream, |
ULONGLONG * | pByteOffset | ||
) |
This function returns the current file position pStream pByteOffset
bool FileStream_GetSize | ( | TFileStream * | pStream, |
ULONGLONG * | pFileSize | ||
) |
Returns the size of a file
pStream Pointer to an open stream FileSize Pointer where to store the file size
bool FileStream_GetTime | ( | TFileStream * | pStream, |
ULONGLONG * | pFileTime | ||
) |
Returns the last write time of a file
pStream Pointer to an open stream pFileType Pointer where to store the file last write time
TFileStream* FileStream_OpenFile | ( | const TCHAR * | szFileName, |
DWORD | dwStreamFlags | ||
) |
This function opens an existing file for read or read-write access
szFileName Name of the file to open dwStreamFlags specifies the provider and base storage type
Returns the length of the provider prefix. Returns zero if no prefix
szFileName Pointer to a stream name (file, mapped file, URL) pdwStreamProvider Pointer to a DWORD variable that receives stream provider (STREAM_PROVIDER_XXX)
bool FileStream_Read | ( | TFileStream * | pStream, |
ULONGLONG * | pByteOffset, | ||
void * | pvBuffer, | ||
DWORD | dwBytesToRead | ||
) |
Reads data from the stream
pStream Pointer to an open stream pByteOffset Pointer to file byte offset. If NULL, it reads from the current position pvBuffer Pointer to data to be read dwBytesToRead Number of bytes to read from the file
bool FileStream_Replace | ( | TFileStream * | pStream, |
TFileStream * | pNewStream | ||
) |
Switches a stream with another. Used for final phase of archive compacting. Performs these steps:
1) Closes the handle to the existing file 2) Renames the temporary file to the original file, overwrites existing one 3) Opens the file stores the handle and stream position to the new stream structure
pStream Pointer to an open stream pNewStream Temporary ("working") stream (created during archive compacting)
bool FileStream_SetCallback | ( | TFileStream * | pStream, |
STREAM_DOWNLOAD_CALLBACK | pfnCallback, | ||
void * | pvUserData | ||
) |
Sets a download callback. Whenever the stream needs to download one or more blocks from the server, the callback is called
pStream Pointer to an open stream pfnCallback Pointer to callback function pvUserData Arbitrary user pointer passed to the download callback
bool FileStream_SetSize | ( | TFileStream * | pStream, |
ULONGLONG | NewFileSize | ||
) |
Sets the size of a file
pStream Pointer to an open stream NewFileSize File size to set
bool FileStream_Write | ( | TFileStream * | pStream, |
ULONGLONG * | pByteOffset, | ||
const void * | pvBuffer, | ||
DWORD | dwBytesToWrite | ||
) |
This function writes data to the stream
pStream Pointer to an open stream pByteOffset Pointer to file byte offset. If NULL, it reads from the current position pvBuffer Pointer to data to be written dwBytesToWrite Number of bytes to write to the file