Base Framework
Public Member Functions | Public Attributes | List of all members
MemorySpan Class Reference

#include <base/Primitives.h>

Public Member Functions

 MemorySpan (const uint8 *begin) noexcept
 
 MemorySpan (const char *begin) noexcept
 
 MemorySpan (const uint8 *_begin, const uint8 *_end) noexcept
 
 MemorySpan (const uint8 *_begin, const MemorySize size) noexcept
 
 MemorySpan (const char *_begin, const char *_end) noexcept
 
 MemorySpan (const char *_begin, const MemorySize size) noexcept
 
bool isProper () const noexcept
 
MemoryDiff getSize () const noexcept
 
uint8 * copyTo (uint8 *dest, const uint8 *end) const noexcept
 
uint8 * copyTo (uint8 *dest) const noexcept
 
char * copyTo (char *dest, const uint8 *end) const noexcept
 
char * copyTo (char *dest) const noexcept
 

Public Attributes

const uint8 * begin = nullptr
 
const uint8 * end = nullptr
 

Detailed Description

Memory span.

Constructor & Destructor Documentation

◆ MemorySpan() [1/2]

MemorySpan::MemorySpan ( const uint8 *  begin)
noexcept

Null-terminated span.

◆ MemorySpan() [2/2]

MemorySpan::MemorySpan ( const char *  begin)
noexcept

Null-terminated span.

Member Function Documentation

◆ copyTo() [1/4]

char* MemorySpan::copyTo ( char *  dest) const
inlinenoexcept

Copy data to given destination which must have room for entire memory span.

◆ copyTo() [2/4]

char* MemorySpan::copyTo ( char *  dest,
const uint8 *  end 
) const
inlinenoexcept

Copy data to given destination.

◆ copyTo() [3/4]

uint8* MemorySpan::copyTo ( uint8 *  dest) const
noexcept

Copy data to given destination which must have room for entire memory span.

◆ copyTo() [4/4]

uint8* MemorySpan::copyTo ( uint8 *  dest,
const uint8 *  end 
) const
noexcept

Copy data to given destination.