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

#include <BytesWriter.h>

Static Public Member Functions

static void ReadBytes (DWORD &uDestination, const char *pSource, int iCount=4)
static void ReadBytes (ULONGLONG &uDestination, const char *pSource, int iCount)
static void ReadBytes (WORD &uDestination, const char *pSource, int iCount=2)
static void WriteBytes (char *pDestination, const ULONGLONG &uSource, int iCount)
static void WriteBytes (char *pDestination, DWORD uSource, int iCount=4)
static void WriteBytes (char *pDestination, WORD uSource)
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

◆ ReadBytes() [1/3]

void ZipArchiveLib::CBytesWriter::ReadBytes ( DWORD & uDestination,
const char * pSource,
int iCount = 4 )
inlinestatic

Reads iCount bytes from pSource into uDestination.

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.

◆ ReadBytes() [2/3]

void ZipArchiveLib::CBytesWriter::ReadBytes ( ULONGLONG & uDestination,
const char * pSource,
int iCount )
inlinestatic

Reads iCount bytes from pSource into uDestination.

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.

◆ ReadBytes() [3/3]

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.

◆ WriteBytes() [1/3]

void ZipArchiveLib::CBytesWriter::WriteBytes ( char * pDestination,
const ULONGLONG & uSource,
int iCount )
inlinestatic

Writes iCount bytes from uSource 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.

◆ WriteBytes() [2/3]

void ZipArchiveLib::CBytesWriter::WriteBytes ( char * pDestination,
DWORD uSource,
int iCount = 4 )
inlinestatic

Writes iCount bytes from uSource 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.

◆ WriteBytes() [3/3]

void ZipArchiveLib::CBytesWriter::WriteBytes ( char * pDestination,
WORD uSource )
inlinestatic

Writes 2 bytes from uSource into pDestination.

Parameters
[out]pDestinationThe buffer to retrieve little-endian ordered data.
[in]uSourceThe buffer with byte-ordering depending on the machine.

◆ WriteSafeU16() [1/2]

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.

◆ WriteSafeU16() [2/2]

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.

◆ WriteSafeU32()

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