NSUNI/NSLAR Library a250670
Loading...
Searching...
No Matches
data.hpp File Reference

Provides functions and classes for handling binary data. More...

#include <array>
#include <type_traits>
#include <utility>
#include "NNL/common/fixed_type.hpp"
#include "NNL/common/io.hpp"

Go to the source code of this file.

Classes

class  nnl::utl::data::MD5Context
 A utility class for calculating MD5 message digests. More...

Namespaces

namespace  nnl
namespace  nnl::utl::data
 Provides functions and classes for handling binary data.

Functions

constexpr u32 nnl::utl::data::FourCC (const char(&str)[5]) noexcept
 Generates a numeric four character code from a given string.
template<typename T>
nnl::utl::data::SwapEndian (T src) noexcept
 Swaps endianness of a value.
template<typename E>
constexpr std::underlying_type< E >::type nnl::utl::data::as_int (E e) noexcept
 Converts an enum value to its underlying integer type.
template<class T, class U>
constexpr T nnl::utl::data::narrow_cast (U &&u) noexcept
 Narrowing cast without bounds checking.
template<class T, class U, typename std::enable_if< std::is_arithmetic< T >::value >::type * = nullptr>
constexpr T nnl::utl::data::narrow (U u)
 Safe narrowing cast with runtime bounds checking.
u32 nnl::utl::data::CRC32 (BufferView data, u32 polynomial=0xEDB88320) noexcept
 Calculates a CRC32 checksum.
u32 nnl::utl::data::XXH32 (BufferView data, u32 seed=0xC0108888)
 Calculates an XXH32 checksum.
std::array< u8, 16 > nnl::utl::data::MD5 (BufferView data) noexcept
 Calculates an MD5 checksum.
template<typename To, typename From>
auto nnl::utl::data::ReinterpretContainer (const std::vector< From > &container)
 Reinterprets container data as a different type (via a bitwise copy)
template<typename To, typename From>
auto nnl::utl::data::CastContainer (const std::vector< From > &container)
 Casts container elements to a different type.

Detailed Description

Provides functions and classes for handling binary data.