CommonLibSSE (powerof3)
Loading...
Searching...
No Matches
DevNull.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/B/BSTSingleton.h"
5#include "RE/L/Location.h"
6#include "RE/S/Stream.h"
7
8namespace 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#ifdef SKYRIM_SUPPORT_AE
34 static_assert(sizeof(NullStream) == 0x18);
35#else
36 static_assert(sizeof(NullStream) == 0x10);
37#endif
38
39 ~DevNull() override; // 00
40
41 // override (Location)
42 ErrorCode DoMount() override; // 01 - { return ErrorCode::kNone; }
43 void DoUnmount() override; // 02 - { return; }
44 ErrorCode DoCreateStream(const char* a_path, BSTSmartPointer<Stream>& a_stream, Location*& a_location, bool a_readOnly) override; // 03
45 ErrorCode DoTraversePrefix(const char* a_path, LocationTraverser& a_traverser) override; // 05 - { return ErrorCode::kNotExist; }
46
47 // members
48 std::uint8_t pad11; // 11
49 std::uint16_t pad12; // 12
50 std::uint32_t pad14; // 14
53 };
54 static_assert(sizeof(DevNull) == 0x28);
55 }
56}
Definition DevNull.h:15
ErrorCode DoTraversePrefix(const char *a_path, LocationTraverser &a_traverser) override
BSTSmartPointer< Stream > nullWriter
Definition DevNull.h:52
std::uint8_t pad11
Definition DevNull.h:48
static constexpr auto VTABLE
Definition DevNull.h:18
BSTSmartPointer< Stream > nullReader
Definition DevNull.h:51
std::uint16_t pad12
Definition DevNull.h:49
void DoUnmount() override
std::uint32_t pad14
Definition DevNull.h:50
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
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