CommonLibVR
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  inline static constexpr auto VTABLE = VTABLE_BSResource____DevNull;
19 
20  struct NullStream : public Stream
21  {
22  public:
23  ~NullStream() override; // 00
24 
25  // override (Stream)
26  ErrorCode DoOpen() override; // 01 - { return ErrorCode::kNone; }
27  void DoClose() override; // 02 - { return; }
28  void DoClone(BSTSmartPointer<Stream>& a_out) const override; // 05
29  ErrorCode DoRead(void* a_buffer, std::uint64_t a_toRead, std::uint64_t& a_read) const override; // 06
30  ErrorCode DoWrite(const void* a_buffer, std::uint64_t a_toWrite, std::uint64_t& a_written) const override; // 07
31  ErrorCode DoSeek(std::uint64_t a_toSeek, SeekMode a_mode, std::uint64_t& a_sought) const override; // 08
32  };
33  static_assert(sizeof(NullStream) == 0x10);
34 
35  ~DevNull() override; // 00
36 
37  // override (Location)
38  ErrorCode DoMount() override; // 01 - { return ErrorCode::kNone; }
39  void DoUnmount() override; // 02 - { return; }
40  ErrorCode DoCreateStream(const char* a_path, BSTSmartPointer<Stream>& a_stream, Location*& a_location, bool a_readOnly) override; // 03
41  ErrorCode DoTraversePrefix(const char* a_path, LocationTraverser& a_traverser) override; // 05 - { return ErrorCode::kNotExist; }
42 
43  // members
44  std::uint8_t pad11; // 11
45  std::uint16_t pad12; // 12
46  std::uint32_t pad14; // 14
49  };
50  static_assert(sizeof(DevNull) == 0x28);
51  }
52 }
Definition: DevNull.h:15
ErrorCode DoTraversePrefix(const char *a_path, LocationTraverser &a_traverser) override
BSTSmartPointer< Stream > nullWriter
Definition: DevNull.h:48
std::uint8_t pad11
Definition: DevNull.h:44
static constexpr auto VTABLE
Definition: DevNull.h:18
BSTSmartPointer< Stream > nullReader
Definition: DevNull.h:47
std::uint16_t pad12
Definition: DevNull.h:45
void DoUnmount() override
std::uint32_t pad14
Definition: DevNull.h:46
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(static_cast< std::uint64_t >(690364))
constexpr std::array< REL::ID, 1 > VTABLE_BSResource____DevNull
Definition: Offsets_VTABLE.h:9412
Definition: DevNull.h:21
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