Skip Navigation Links
Skip Navigation LinksHome > ZipArchive > How to Use > API Documentation
ZipArchiveLib::CBytesWriter Class Reference

#include <BytesWriter.h>

Static Public Member Functions

static void ReadBytes (WORD &uDestination, const char *pSource, int iCount=2)
 
static void ReadBytes (DWORD &uDestination, const char *pSource, int iCount=4)
 
static void ReadBytes (ULONGLONG &uDestination, const char *pSource, int iCount)
 
static void WriteBytes (char *pDestination, WORD uSource)
 
static void WriteBytes (char *pDestination, DWORD uSource, int iCount=4)
 
static void WriteBytes (char *pDestination, const ULONGLONG &uSource, int iCount)
 
static WORD WriteSafeU16 (DWORD uValue)
 
static WORD WriteSafeU16 (ULONGLONG uValue)
 
static DWORD WriteSafeU32 (ZIP_SIZE_TYPE uValue)
 

Detailed Description

Provides implementation for various buffer operations depending on the current platform and configuration.

Member Function Documentation

static void ZipArchiveLib::CBytesWriter::ReadBytes ( WORD &  uDestination,
const char *  pSource,
int  iCount = 2 
)
inlinestatic

Reads iCount bytes from pSource into pDestination.

Parameters
[out]uDestinationThe buffer to retrieve data with byte-ordering depending on the machine.
[in]pSourceThe buffer with little-endian ordered data.
iCountThe number of bytes to read.
static void ZipArchiveLib::CBytesWriter::WriteBytes ( char *  pDestination,
DWORD  uSource,
int  iCount = 4 
)
inlinestatic

Writes iCount bytes from pSource into pDestination.

Parameters
[out]pDestinationThe buffer to retrieve little-endian ordered data.
[in]uSourceThe buffer with byte-ordering depending on the machine.
iCountThe number of bytes to write.
static WORD ZipArchiveLib::CBytesWriter::WriteSafeU16 ( DWORD  uValue)
inlinestatic

Writes safely a 32-bit value to a 16-bit value. If the 32-bit value is larger than USHRT_MAX, then USHRT_MAX is written; otherwise the original value is written.

Parameters
uValueThe value to write.
Returns
A safe value.
static WORD ZipArchiveLib::CBytesWriter::WriteSafeU16 ( ULONGLONG  uValue)
inlinestatic

Writes safely a 64-bit value to a 16-bit value. If the 64-bit value is larger than USHRT_MAX, then USHRT_MAX is written; otherwise the original value is written.

Parameters
uValueThe value to write.
Returns
A safe value.
static DWORD ZipArchiveLib::CBytesWriter::WriteSafeU32 ( ZIP_SIZE_TYPE  uValue)
inlinestatic

Writes safely a 64-bit value to a 32-bit value. If the 64-bit value is larger than UINT_MAX, then UINT_MAX is written; otherwise the original value is written.

Parameters
uValueThe value to write.
Returns
A safe value.

The documentation for this class was generated from the following file:
Back To Top Up