7#include <Common/assertion.h>
8#include <Common/memory.h>
25 template<
typename T,
bool DO_BYTE_REVERSAL = false>
28 template<
typename T,
bool DO_BYTE_REVERSAL = false>
36template<
typename T,
bool DO_BYTE_REVERSAL>
42template<
typename T,
bool DO_BYTE_REVERSAL>
45 static_assert(std::is_trivially_copyable_v<T>);
46 PH_ASSERT(data.data());
48 auto const dataAsBytes = std::as_bytes(data);
49 if constexpr(DO_BYTE_REVERSAL)
51 for(std::size_t di = 0; di < data.size(); ++di)
53 std::array<std::byte,
sizeof(T)> reversedBytes;
55 reinterpret_cast<const std::byte*
>(&data[di]),
sizeof(T), reversedBytes.data());
56 reverse_bytes<sizeof(T)>(reversedBytes.data());
61 write(
sizeof(T), reversedBytes.data());
66 write(dataAsBytes.size(), dataAsBytes.data());
Definition BinaryFileOutputStream.h:19
BinaryFileOutputStream()=default
BinaryFileOutputStream(BinaryFileOutputStream &&other)=default
void writeData(const T *data)
Definition BinaryFileOutputStream.h:37
BinaryFileOutputStream & operator=(BinaryFileOutputStream &&rhs)=default
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition StdOutputStream.h:15
void write(std::size_t numBytes, const std::byte *bytes) override
Write data in the form of raw bytes in one go. The method does not return before finishing the writin...
Definition StdOutputStream.cpp:26
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19