33 [[nodiscard]]
virtual bool good()
const = 0;
34 virtual void seek(std::int32_t a_numBytes) = 0;
35 [[nodiscard]]
virtual std::uint32_t
tell()
const;
39 template <
class CharT>
40 bool get(CharT& a_ch);
41 template <
class CharT>
42 bool read(CharT* a_str, std::uint32_t a_count);
43 template <
class CharT>
45 template <
class CharT>
46 bool write(
const CharT* a_str, std::uint32_t a_count);
49 using ReadFn = std::uint32_t(
NiBinaryStream* a_this,
void* a_buffer, std::uint32_t a_bytes, std::uint32_t* a_componentSizes, std::uint32_t a_numComponents);
50 using WriteFn = std::uint32_t(
NiBinaryStream* a_this,
const void* a_buffer, std::uint32_t a_bytes, std::uint32_t* a_componentSizes, std::uint32_t a_numComponents);
52 std::uint32_t
binary_read(
void* a_buffer, std::uint32_t a_totalBytes, std::uint32_t* a_componentSizes, std::uint32_t a_numComponents = 1);
53 std::uint32_t
binary_write(
const void* a_buffer, std::uint32_t a_totalBytes, std::uint32_t* a_componentSizes, std::uint32_t a_numComponents = 1);
65 template <
class CharT>
68 return read(&a_ch, 1);
71 template <
class CharT>
74 std::uint32_t size =
sizeof(CharT);
75 std::uint32_t toRead = a_count * size;
76 std::uint32_t bytesRead =
binary_read(a_str, toRead, &size);
77 return bytesRead == toRead;
80 template <
class CharT>
83 return write(&a_ch, 1);
86 template <
class CharT>
89 std::uint32_t size =
sizeof(CharT);
90 std::uint32_t toWrite = a_count * size;
91 std::uint32_t bytesWritten =
binary_write(a_str, toWrite, &size);
92 return bytesWritten == toWrite;
98 template <
class CharT,
class Traits,
class Allocator>
101 CharT delim = std::use_facet<std::ctype<CharT>>(std::locale()).widen(
'\n');
102 return getline(a_input, a_str, delim);
105 template <
class CharT,
class Traits,
class Allocator>
110 auto notEOF = a_input.
get(c);
113 if (!std::char_traits<CharT>::eq(c, a_delim)) {
119 if (a_str.size() != a_str.max_size()) {
120 notEOF = a_input.
get(c);
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: NiBinaryStream.h:6
bool get(CharT &a_ch)
Definition: NiBinaryStream.h:66
std::uint32_t(NiBinaryStream *a_this, void *a_buffer, std::uint32_t a_bytes, std::uint32_t *a_componentSizes, std::uint32_t a_numComponents) ReadFn
Definition: NiBinaryStream.h:49
WriteFn * _writeFn
Definition: NiBinaryStream.h:59
static constexpr auto VTABLE
Definition: NiBinaryStream.h:9
virtual void seek(std::int32_t a_numBytes)=0
std::uint32_t(NiBinaryStream *a_this, const void *a_buffer, std::uint32_t a_bytes, std::uint32_t *a_componentSizes, std::uint32_t a_numComponents) WriteFn
Definition: NiBinaryStream.h:50
virtual std::uint32_t tell() const
virtual void set_endian_swap(bool a_doSwap)=0
static constexpr auto RTTI
Definition: NiBinaryStream.h:8
std::uint32_t _pad0C
Definition: NiBinaryStream.h:57
std::uint32_t binary_write(const void *a_buffer, std::uint32_t a_totalBytes, std::uint32_t *a_componentSizes, std::uint32_t a_numComponents=1)
bool write(const CharT *a_str, std::uint32_t a_count)
Definition: NiBinaryStream.h:87
bool read(CharT *a_str, std::uint32_t a_count)
Definition: NiBinaryStream.h:72
virtual void get_info(BufferInfo &a_buf)
std::int32_t off_type
Definition: NiBinaryStream.h:13
virtual ~NiBinaryStream()
virtual bool good() const =0
ReadFn * _readFn
Definition: NiBinaryStream.h:58
std::uint32_t _absoluteCurrentPos
Definition: NiBinaryStream.h:56
bool put(CharT a_ch)
Definition: NiBinaryStream.h:81
std::int32_t int_type
Definition: NiBinaryStream.h:11
std::uint32_t binary_read(void *a_buffer, std::uint32_t a_totalBytes, std::uint32_t *a_componentSizes, std::uint32_t a_numComponents=1)
std::uint32_t pos_type
Definition: NiBinaryStream.h:12
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_NiBinaryStream(static_cast< std::uint64_t >(685333))
constexpr std::array< REL::ID, 1 > VTABLE_NiBinaryStream
Definition: Offsets_VTABLE.h:12165
Definition: EffectArchetypes.h:65
bool getline(RE::NiBinaryStream &a_input, std::basic_string< CharT, Traits, Allocator > &a_str)
Definition: NiBinaryStream.h:99
Definition: NiBinaryStream.h:16
std::uint32_t streamPos
Definition: NiBinaryStream.h:24
std::uint32_t bufferPos
Definition: NiBinaryStream.h:23
std::uint32_t bufferAllocSize
Definition: NiBinaryStream.h:21
std::uint32_t totalSize
Definition: NiBinaryStream.h:20
void * buffer
Definition: NiBinaryStream.h:19
std::uint32_t pad1C
Definition: NiBinaryStream.h:25
std::uint32_t bufferReadSize
Definition: NiBinaryStream.h:22