TRLC Platform Library  1.0.0
Header-only C++ library for compile-time platform detection and abstraction
trlc::platform::EndiannessInfo Struct Reference

Comprehensive endianness information structure. More...

#include <trlc/platform/endianness.hpp>

Static Public Member Functions

static bool isNativeOrder (ByteOrder order) const
 Check if given byte order matches native order. More...
 
static bool needsByteSwap (ByteOrder target_order) const
 Check if byte swapping is needed for target order. More...
 

Public Attributes

ByteOrder byte_order
 The detected byte order. More...
 
bool is_little_endian
 True if system is little-endian. More...
 
bool is_big_endian
 True if system is big-endian. More...
 

Detailed Description

Comprehensive endianness information structure.

Provides complete information about the system's byte order including convenient boolean flags and utility methods for byte order operations.

Definition at line 46 of file endianness.hpp.

Member Function Documentation

◆ isNativeOrder()

static bool trlc::platform::EndiannessInfo::isNativeOrder ( ByteOrder  order) const
inlinestatic

Check if given byte order matches native order.

Parameters
orderByte order to check
Returns
true if order matches native byte order

Definition at line 56 of file endianness.hpp.

◆ needsByteSwap()

static bool trlc::platform::EndiannessInfo::needsByteSwap ( ByteOrder  target_order) const
inlinestatic

Check if byte swapping is needed for target order.

Parameters
target_orderTarget byte order
Returns
true if byte swapping is required

Definition at line 63 of file endianness.hpp.

Member Data Documentation

◆ byte_order

ByteOrder trlc::platform::EndiannessInfo::byte_order

The detected byte order.

Definition at line 47 of file endianness.hpp.

◆ is_big_endian

bool trlc::platform::EndiannessInfo::is_big_endian

True if system is big-endian.

Definition at line 49 of file endianness.hpp.

◆ is_little_endian

bool trlc::platform::EndiannessInfo::is_little_endian

True if system is little-endian.

Definition at line 48 of file endianness.hpp.


The documentation for this struct was generated from the following file: