CommonLibSSE (Parapets fork)
DevNull.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTSingleton.h"
4 #include "RE/B/BSTSmartPointer.h"
5 #include "RE/L/Location.h"
6 #include "RE/S/Stream.h"
7 
8 namespace RE
9 {
10  namespace BSResource
11  {
12  class DevNull :
13  public Location, // 00
14  public BSTSingletonSDM<DevNull> // 10
15  {
16  public:
17  inline static constexpr auto RTTI = RTTI_BSResource____DevNull;
18 
19  struct NullStream : public Stream
20  {
21  public:
22  ~NullStream() override; // 00
23 
24  // override (Stream)
25  ErrorCode DoOpen() override; // 01 - { return ErrorCode::kNone; }
26  void DoClose() override; // 02 - { return; }
27  void DoClone(BSTSmartPointer<Stream>& a_out) const override; // 05
28  ErrorCode DoRead(void* a_buffer, std::uint64_t a_toRead, std::uint64_t& a_read) const override; // 06
29  ErrorCode DoWrite(const void* a_buffer, std::uint64_t a_toWrite, std::uint64_t& a_written) const override; // 07
30  ErrorCode DoSeek(std::uint64_t a_toSeek, SeekMode a_mode, std::uint64_t& a_sought) const override; // 08
31  };
32  static_assert(sizeof(NullStream) == 0x10);
33 
34  ~DevNull() override; // 00
35 
36  // override (Location)
37  ErrorCode DoMount() override; // 01 - { return ErrorCode::kNone; }
38  void DoUnmount() override; // 02 - { return; }
39  ErrorCode DoCreateStream(const char* a_path, BSTSmartPointer<Stream>& a_stream, Location*& a_location, bool a_readOnly) override; // 03
40  ErrorCode DoTraversePrefix(const char* a_path, LocationTraverser& a_traverser) override; // 05 - { return ErrorCode::kNotExist; }
41 
42  // members
43  std::uint8_t pad11; // 11
44  std::uint16_t pad12; // 12
45  std::uint32_t pad14; // 14
48  };
49  static_assert(sizeof(DevNull) == 0x28);
50  }
51 }
Definition: DevNull.h:15
ErrorCode DoTraversePrefix(const char *a_path, LocationTraverser &a_traverser) override
BSTSmartPointer< Stream > nullWriter
Definition: DevNull.h:47
std::uint8_t pad11
Definition: DevNull.h:43
BSTSmartPointer< Stream > nullReader
Definition: DevNull.h:46
std::uint16_t pad12
Definition: DevNull.h:44
void DoUnmount() override
std::uint32_t pad14
Definition: DevNull.h:45
ErrorCode DoCreateStream(const char *a_path, BSTSmartPointer< Stream > &a_stream, Location *&a_location, bool a_readOnly) override
static constexpr auto RTTI
Definition: DevNull.h:17
ErrorCode DoMount() override
Definition: LocationTraverser.h:10
Definition: Location.h:17
Definition: Stream.h:21
Definition: BSTSmartPointer.h:37
ErrorCode
Definition: ErrorCodes.h:8
SeekMode
Definition: Stream.h:14
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BSResource____DevNull
Definition: Offsets_RTTI.h:2136
Definition: DevNull.h:20
ErrorCode DoSeek(std::uint64_t a_toSeek, SeekMode a_mode, std::uint64_t &a_sought) const override
ErrorCode DoWrite(const void *a_buffer, std::uint64_t a_toWrite, std::uint64_t &a_written) const override
ErrorCode DoRead(void *a_buffer, std::uint64_t a_toRead, std::uint64_t &a_read) const override
void DoClone(BSTSmartPointer< Stream > &a_out) const override
Definition: BSTSingleton.h:50