Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cMemBlock Class Reference

#include <cMem.h>

Inheritance diagram for Gray::cMemBlock:
Gray::StrBuilder Gray::cHeapBlock GrayLib::cASNBuf GrayLib::cASNReader GrayLib::cASNWriterRev GrayLib::cSurfaceBase Gray::StrBuilderAlloc GrayLib::cHashCode GrayLib::cPEM GrayLib::cVariantArrayT GrayLib::cWaveFormat GrayLib::cASNBufAlloc GrayLib::cASNSequence GrayLib::cX509Reader GrayLib::cImageBase GrayLib::cSurface

Public Member Functions

 cMemBlock () noexcept
 
 cMemBlock (const void *pData, size_t nSize) noexcept
 
 cMemBlock (const cMemBlock &block) noexcept
 
 cMemBlock (const cMemBlock *pBlock) noexcept
 
size_t get_DataSize () const noexcept
 
void * get_Data () const noexcept
 
BYTE * get_DataBytes () const noexcept
 
char * get_DataA () const noexcept
 
 operator const BYTE * () const noexcept
 
bool isValidPtr () const noexcept
 
bool IsValidIndex (size_t i) const noexcept
 
bool IsValidIndex2 (size_t i) const noexcept
 
bool IsValidPtr (const void *p) const noexcept
 
bool IsValidPtr2 (const void *p) const noexcept
 
bool IsZeros () const noexcept
 
bool IsEqualData (const void *pData, size_t nSize) const noexcept
 
bool IsEqualData (const cMemBlock *pData) const noexcept
 
bool IsEqualData (const cMemBlock &data) const noexcept
 
BYTE * GetOffset (size_t nOffset) const
 
const void * get_DataEnd () const noexcept
 
void put_DataPtr (void *pStart) noexcept
 
void put_Size (size_t nSize) noexcept
 
void SetBlock (void *pData, size_t nSize) noexcept
 
void SetEmptyBlock () noexcept
 
void InitZeros () noexcept
 
StrLen_t ConvertToString (char *pszDst, StrLen_t iDstSizeMax) const
 

Static Public Member Functions

static COMPARE_t __stdcall Compare (const void *pData1, size_t iLen1, const void *pData2, size_t iLen2)
 

Protected Attributes

size_t m_nSize
 size_t of m_pData in bytes. May be determined at runtime. More...
 
void * m_pData
 

Detailed Description

A pointer to memory block/blob with unknown ownership. heap, stack or const. don't free on destruct. May be static init?

Constructor & Destructor Documentation

◆ cMemBlock() [1/4]

Gray::cMemBlock::cMemBlock ( )
inlinenoexcept

◆ cMemBlock() [2/4]

Gray::cMemBlock::cMemBlock ( const void *  pData,
size_t  nSize 
)
inlinenoexcept

◆ cMemBlock() [3/4]

Gray::cMemBlock::cMemBlock ( const cMemBlock block)
inlinenoexcept

◆ cMemBlock() [4/4]

Gray::cMemBlock::cMemBlock ( const cMemBlock pBlock)
inlinenoexcept

Member Function Documentation

◆ Compare()

COMPARE_t GRAYCALL Gray::cMemBlock::Compare ( const void *  pData1,
size_t  iLen1,
const void *  pData2,
size_t  iLen2 
)
static
Returns
COMPARE_Equal

◆ ConvertToString()

StrLen_t Gray::cMemBlock::ConvertToString ( char *  pszDst,
StrLen_t  iDstSizeMax 
) const
inline

◆ get_Data()

void* Gray::cMemBlock::get_Data ( ) const
inlinenoexcept

Might be nullptr. that's OK.

◆ get_DataA()

char* Gray::cMemBlock::get_DataA ( ) const
inlinenoexcept

Get as a char pointer.

◆ get_DataBytes()

BYTE* Gray::cMemBlock::get_DataBytes ( ) const
inlinenoexcept

Get as a BYTE pointer.

◆ get_DataEnd()

const void* Gray::cMemBlock::get_DataEnd ( ) const
inlinenoexcept

Never write to this pointer.

◆ get_DataSize()

size_t Gray::cMemBlock::get_DataSize ( ) const
inlinenoexcept

◆ GetOffset()

BYTE* Gray::cMemBlock::GetOffset ( size_t  nOffset) const
inline

Get as a byte pointer.

◆ InitZeros()

void Gray::cMemBlock::InitZeros ( )
inlinenoexcept

◆ IsEqualData() [1/3]

bool Gray::cMemBlock::IsEqualData ( const cMemBlock data) const
inlinenoexcept

compare blocks of data.

◆ IsEqualData() [2/3]

bool Gray::cMemBlock::IsEqualData ( const cMemBlock pData) const
inlinenoexcept

compare blocks of data.

◆ IsEqualData() [3/3]

bool Gray::cMemBlock::IsEqualData ( const void *  pData,
size_t  nSize 
) const
inlinenoexcept

compare blocks of data.

◆ IsValidIndex()

bool Gray::cMemBlock::IsValidIndex ( size_t  i) const
inlinenoexcept

Is i inside the known valid range for the block?

◆ IsValidIndex2()

bool Gray::cMemBlock::IsValidIndex2 ( size_t  i) const
inlinenoexcept

Is i inside the known valid range for the block? or at end?

◆ isValidPtr()

bool Gray::cMemBlock::isValidPtr ( ) const
inlinenoexcept

Is this (probably) valid to use/read/write. not nullptr. Use cMem::IsValid to know more.

◆ IsValidPtr()

bool Gray::cMemBlock::IsValidPtr ( const void *  p) const
inlinenoexcept

Is p inside the known valid range for the block? Inclusive = Can be equal to end.

◆ IsValidPtr2()

bool Gray::cMemBlock::IsValidPtr2 ( const void *  p) const
inlinenoexcept

Is p inside the known valid range for the block? Exclusive = Cant be equal to end!

◆ IsZeros()

bool Gray::cMemBlock::IsZeros ( ) const
inlinenoexcept

◆ operator const BYTE *()

Gray::cMemBlock::operator const BYTE * ( ) const
inlinenoexcept

Get as a BYTE pointer.

◆ put_DataPtr()

void Gray::cMemBlock::put_DataPtr ( void *  pStart)
inlinenoexcept

◆ put_Size()

void Gray::cMemBlock::put_Size ( size_t  nSize)
inlinenoexcept

◆ SetBlock()

void Gray::cMemBlock::SetBlock ( void *  pData,
size_t  nSize 
)
inlinenoexcept

◆ SetEmptyBlock()

void Gray::cMemBlock::SetEmptyBlock ( )
inlinenoexcept

Member Data Documentation

◆ m_nSize

size_t Gray::cMemBlock::m_nSize
protected

size_t of m_pData in bytes. May be determined at runtime.

◆ m_pData

void* Gray::cMemBlock::m_pData
protected

The documentation for this class was generated from the following files: