CommonLibSSE NG
NiFile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/N/NiBinaryStream.h"
4 
5 namespace RE
6 {
7  class NiFile : public NiBinaryStream
8  {
9  public:
10  inline static constexpr auto RTTI = RTTI_NiFile;
11 
12  enum class OpenMode
13  {
14  kReadOnly = 0,
15  kWriteOnly = 1,
16  kAppendOnly = 2
17  };
18 
19  ~NiFile() override; // 00
20 
21  // override (NiBinaryStream)
22  bool good() const override; // 01 - { return isGood; }
23  void seek(std::int32_t a_numBytes) override; // 02
24  void get_info(BufferInfo& a_buf) override; // 04
25  void set_endian_swap(bool a_doSwap) override; // 05
26 
27  // add
28  virtual void seek(std::int32_t a_offset, std::int32_t a_from); // 06
29  [[nodiscard]] virtual std::uint32_t size() const; // 07
30 
31  // members
32  std::uint32_t bufferAllocSize; // 20
33  std::uint32_t bufferReadSize; // 24
34  std::uint32_t pos; // 28
35  std::uint32_t pad2C; // 2C
36  char* buffer; // 30
37  std::FILE* file; // 38
39  bool isGood; // 44
40  std::uint8_t pad45; // 45
41  std::uint16_t pad46; // 46
42  };
43  static_assert(sizeof(NiFile) == 0x48);
44 }
Definition: NiBinaryStream.h:6
Definition: NiFile.h:8
char * buffer
Definition: NiFile.h:36
virtual std::uint32_t size() const
OpenMode
Definition: NiFile.h:13
std::uint32_t pos
Definition: NiFile.h:34
bool isGood
Definition: NiFile.h:39
std::uint16_t pad46
Definition: NiFile.h:41
bool good() const override
void seek(std::int32_t a_numBytes) override
~NiFile() override
void set_endian_swap(bool a_doSwap) override
virtual void seek(std::int32_t a_offset, std::int32_t a_from)
std::FILE * file
Definition: NiFile.h:37
std::uint32_t bufferReadSize
Definition: NiFile.h:33
std::uint32_t pad2C
Definition: NiFile.h:35
static constexpr auto RTTI
Definition: NiFile.h:10
std::uint8_t pad45
Definition: NiFile.h:40
stl::enumeration< OpenMode, std::uint32_t > mode
Definition: NiFile.h:38
void get_info(BufferInfo &a_buf) override
std::uint32_t bufferAllocSize
Definition: NiFile.h:32
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_NiFile(690321, 398176, 0x1f5ff88)
Definition: NiBinaryStream.h:15