PLYwoot
Header-only C++17 library for parsing and writing PLY files
Loading...
Searching...
No Matches
endian.hpp File Reference
#include <type_traits>
#include <utility>

Go to the source code of this file.

Typedefs

using plywoot::detail::HostEndian = std::conditional_t< __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__, LittleEndian, BigEndian >
 

Functions

template<typename T >
plywoot::detail::byte_swap (T t)
 

Typedef Documentation

◆ HostEndian

using plywoot::detail::HostEndian = typedef std::conditional_t<__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, LittleEndian, BigEndian>

Alias type encoding the host platform endianness. Based on the possible implementation for std::endian documented on cppreference.com.

Definition at line 47 of file endian.hpp.

Function Documentation

◆ byte_swap()

template<typename T >
T plywoot::detail::byte_swap ( t)

Naive byte swap functions for floating point numbers to convert between endian representations.

Parameters
tfloating point number to convert
Returns
t converted from either big/little to little/big endian

Definition at line 56 of file endian.hpp.