CppCommon  1.0.4.1
C++ Common Library
Public Member Functions | Static Public Member Functions | List of all members
CppCommon::Endian Class Reference

Big/Little-endian utilities. More...

#include <endian.h>

Public Member Functions

 Endian ()=delete
 
 Endian (const Endian &)=delete
 
 Endian (Endian &&)=delete
 
 ~Endian ()=delete
 
Endianoperator= (const Endian &)=delete
 
Endianoperator= (Endian &&)=delete
 

Static Public Member Functions

static bool IsBigEndian ()
 Is big-endian system? More...
 
static bool IsLittleEndian ()
 Is little-endian system? More...
 
static size_t ReadBigEndian (const void *buffer, int16_t &value)
 Read big-endian signed 16-bit integer value from the given buffer. More...
 
static size_t ReadBigEndian (const void *buffer, uint16_t &value)
 Read big-endian unsigned 16-bit integer value from the given buffer. More...
 
static size_t ReadBigEndian (const void *buffer, int32_t &value)
 Read big-endian signed 32-bit integer value from the given buffer. More...
 
static size_t ReadBigEndian (const void *buffer, uint32_t &value)
 Read big-endian unsigned 32-bit integer value from the given buffer. More...
 
static size_t ReadBigEndian (const void *buffer, int64_t &value)
 Read big-endian signed 64-bit integer value from the given buffer. More...
 
static size_t ReadBigEndian (const void *buffer, uint64_t &value)
 Read big-endian unsigned 64-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, int16_t &value)
 Read little-endian signed 16-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, uint16_t &value)
 Read little-endian unsigned 16-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, int32_t &value)
 Read little-endian signed 32-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, uint32_t &value)
 Read little-endian unsigned 32-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, int64_t &value)
 Read little-endian signed 64-bit integer value from the given buffer. More...
 
static size_t ReadLittleEndian (const void *buffer, uint64_t &value)
 Read little-endian unsigned 64-bit integer value from the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, int16_t value)
 Write big-endian signed 16-bit integer value into the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, uint16_t value)
 Write big-endian unsigned 16-bit integer value into the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, int32_t value)
 Write big-endian signed 32-bit integer value into the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, uint32_t value)
 Write big-endian unsigned 32-bit integer value into the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, int64_t value)
 Write big-endian signed 64-bit integer value into the given buffer. More...
 
static size_t WriteBigEndian (void *buffer, uint64_t value)
 Write big-endian unsigned 64-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, int16_t value)
 Write little-endian signed 16-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, uint16_t value)
 Write little-endian unsigned 16-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, int32_t value)
 Write little-endian signed 32-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, uint32_t value)
 Write little-endian unsigned 32-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, int64_t value)
 Write little-endian signed 64-bit integer value into the given buffer. More...
 
static size_t WriteLittleEndian (void *buffer, uint64_t value)
 Write little-endian unsigned 64-bit integer value into the given buffer. More...
 

Detailed Description

Big/Little-endian utilities.

Big/Little-endian utilities contains methods for big<->little endian conversions.

Thread-safe.

Definition at line 23 of file endian.h.

Constructor & Destructor Documentation

◆ Endian() [1/3]

CppCommon::Endian::Endian ( )
delete

◆ Endian() [2/3]

CppCommon::Endian::Endian ( const Endian )
delete

◆ Endian() [3/3]

CppCommon::Endian::Endian ( Endian &&  )
delete

◆ ~Endian()

CppCommon::Endian::~Endian ( )
delete

Member Function Documentation

◆ IsBigEndian()

bool CppCommon::Endian::IsBigEndian ( )
inlinestatic

Is big-endian system?

Definition at line 11 of file endian.inl.

◆ IsLittleEndian()

bool CppCommon::Endian::IsLittleEndian ( )
inlinestatic

Is little-endian system?

Definition at line 16 of file endian.inl.

◆ operator=() [1/2]

Endian& CppCommon::Endian::operator= ( const Endian )
delete

◆ operator=() [2/2]

Endian& CppCommon::Endian::operator= ( Endian &&  )
delete

◆ ReadBigEndian() [1/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
int16_t &  value 
)
inlinestatic

Read big-endian signed 16-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 16-bit integer value
Returns
Count of read bytes

Definition at line 21 of file endian.inl.

◆ ReadBigEndian() [2/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
int32_t &  value 
)
inlinestatic

Read big-endian signed 32-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 32-bit integer value
Returns
Count of read bytes

Definition at line 53 of file endian.inl.

◆ ReadBigEndian() [3/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
int64_t &  value 
)
inlinestatic

Read big-endian signed 64-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 64-bit integer value
Returns
Count of read bytes

Definition at line 93 of file endian.inl.

◆ ReadBigEndian() [4/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
uint16_t &  value 
)
inlinestatic

Read big-endian unsigned 16-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 16-bit integer value
Returns
Count of read bytes

Definition at line 37 of file endian.inl.

◆ ReadBigEndian() [5/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
uint32_t &  value 
)
inlinestatic

Read big-endian unsigned 32-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 32-bit integer value
Returns
Count of read bytes

Definition at line 73 of file endian.inl.

◆ ReadBigEndian() [6/6]

size_t CppCommon::Endian::ReadBigEndian ( const void *  buffer,
uint64_t &  value 
)
inlinestatic

Read big-endian unsigned 64-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 64-bit integer value
Returns
Count of read bytes

Definition at line 121 of file endian.inl.

◆ ReadLittleEndian() [1/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
int16_t &  value 
)
inlinestatic

Read little-endian signed 16-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 16-bit integer value
Returns
Count of read bytes

Definition at line 149 of file endian.inl.

◆ ReadLittleEndian() [2/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
int32_t &  value 
)
inlinestatic

Read little-endian signed 32-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 32-bit integer value
Returns
Count of read bytes

Definition at line 181 of file endian.inl.

◆ ReadLittleEndian() [3/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
int64_t &  value 
)
inlinestatic

Read little-endian signed 64-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Signed 64-bit integer value
Returns
Count of read bytes

Definition at line 221 of file endian.inl.

◆ ReadLittleEndian() [4/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
uint16_t &  value 
)
inlinestatic

Read little-endian unsigned 16-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 16-bit integer value
Returns
Count of read bytes

Definition at line 165 of file endian.inl.

◆ ReadLittleEndian() [5/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
uint32_t &  value 
)
inlinestatic

Read little-endian unsigned 32-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 32-bit integer value
Returns
Count of read bytes

Definition at line 201 of file endian.inl.

◆ ReadLittleEndian() [6/6]

size_t CppCommon::Endian::ReadLittleEndian ( const void *  buffer,
uint64_t &  value 
)
inlinestatic

Read little-endian unsigned 64-bit integer value from the given buffer.

Parameters
buffer- Buffer to read
value- Unsigned 64-bit integer value
Returns
Count of read bytes

Definition at line 249 of file endian.inl.

◆ WriteBigEndian() [1/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
int16_t  value 
)
inlinestatic

Write big-endian signed 16-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 16-bit integer value
Returns
Count of written bytes

Definition at line 277 of file endian.inl.

◆ WriteBigEndian() [2/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
int32_t  value 
)
inlinestatic

Write big-endian signed 32-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 32-bit integer value
Returns
Count of written bytes

Definition at line 309 of file endian.inl.

◆ WriteBigEndian() [3/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
int64_t  value 
)
inlinestatic

Write big-endian signed 64-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 64-bit integer value
Returns
Count of written bytes

Definition at line 349 of file endian.inl.

◆ WriteBigEndian() [4/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
uint16_t  value 
)
inlinestatic

Write big-endian unsigned 16-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 16-bit integer value
Returns
Count of written bytes

Definition at line 293 of file endian.inl.

◆ WriteBigEndian() [5/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
uint32_t  value 
)
inlinestatic

Write big-endian unsigned 32-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 32-bit integer value
Returns
Count of written bytes

Definition at line 329 of file endian.inl.

◆ WriteBigEndian() [6/6]

size_t CppCommon::Endian::WriteBigEndian ( void *  buffer,
uint64_t  value 
)
inlinestatic

Write big-endian unsigned 64-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 64-bit integer value
Returns
Count of written bytes

Definition at line 377 of file endian.inl.

◆ WriteLittleEndian() [1/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
int16_t  value 
)
inlinestatic

Write little-endian signed 16-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 16-bit integer value
Returns
Count of written bytes

Definition at line 405 of file endian.inl.

◆ WriteLittleEndian() [2/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
int32_t  value 
)
inlinestatic

Write little-endian signed 32-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 32-bit integer value
Returns
Count of written bytes

Definition at line 437 of file endian.inl.

◆ WriteLittleEndian() [3/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
int64_t  value 
)
inlinestatic

Write little-endian signed 64-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Signed 64-bit integer value
Returns
Count of written bytes

Definition at line 477 of file endian.inl.

◆ WriteLittleEndian() [4/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
uint16_t  value 
)
inlinestatic

Write little-endian unsigned 16-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 16-bit integer value
Returns
Count of written bytes

Definition at line 421 of file endian.inl.

◆ WriteLittleEndian() [5/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
uint32_t  value 
)
inlinestatic

Write little-endian unsigned 32-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 32-bit integer value
Returns
Count of written bytes

Definition at line 457 of file endian.inl.

◆ WriteLittleEndian() [6/6]

size_t CppCommon::Endian::WriteLittleEndian ( void *  buffer,
uint64_t  value 
)
inlinestatic

Write little-endian unsigned 64-bit integer value into the given buffer.

Parameters
buffer- Buffer to write
value- Unsigned 64-bit integer value
Returns
Count of written bytes

Definition at line 505 of file endian.inl.


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