CommonLibSSE NG
Stream.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSFixedString.h"
4 #include "RE/B/BSTSmartPointer.h"
5 #include "RE/S/StreamBase.h"
6 
7 namespace RE
8 {
9  namespace BSResource
10  {
11  class AsyncStream;
12 
13  enum class SeekMode
14  {
15  kSet = 0,
16  kCur = 1,
17  kEnd = 2
18  };
19 
20  class Stream : public StreamBase
21  {
22  public:
23  inline static constexpr auto RTTI = RTTI_BSResource__Stream;
24 
25  Stream();
26  Stream(const Stream& a_rhs);
27  Stream(Stream&& a_rhs);
28  Stream(std::uint32_t a_totalSize);
29  ~Stream() override = default; // 00
30 
31  // add
32  virtual void DoClone(BSTSmartPointer<Stream>& a_out) const = 0; // 05
33  virtual ErrorCode DoRead(void* a_buffer, std::uint64_t a_toRead, std::uint64_t& a_read) const = 0; // 06
34  virtual ErrorCode DoWrite(const void* a_buffer, std::uint64_t a_toWrite, std::uint64_t& a_written) const = 0; // 07
35  virtual ErrorCode DoSeek(std::uint64_t a_toSeek, SeekMode a_mode, std::uint64_t& a_sought) const = 0; // 08
36  virtual ErrorCode DoSetEndOfStream(); // 09 - { return ErrorCode::kUnsupported; }
37  virtual bool DoGetName(BSFixedString& a_dst) const; // 0A - { a_dst = ""; return false; }
38  virtual ErrorCode DoCreateAsync(BSTSmartPointer<AsyncStream>& a_streamOut) const; // 0B - { return ErrorCode::kUnsupported; }
39  };
40  static_assert(sizeof(Stream) == 0x10);
41  }
42 }
Definition: StreamBase.h:13
Definition: Stream.h:21
Stream(Stream &&a_rhs)
virtual ErrorCode DoCreateAsync(BSTSmartPointer< AsyncStream > &a_streamOut) const
Stream(std::uint32_t a_totalSize)
Stream(const Stream &a_rhs)
virtual ErrorCode DoSeek(std::uint64_t a_toSeek, SeekMode a_mode, std::uint64_t &a_sought) const =0
virtual void DoClone(BSTSmartPointer< Stream > &a_out) const =0
static constexpr auto RTTI
Definition: Stream.h:23
virtual bool DoGetName(BSFixedString &a_dst) const
virtual ErrorCode DoRead(void *a_buffer, std::uint64_t a_toRead, std::uint64_t &a_read) const =0
~Stream() override=default
virtual ErrorCode DoWrite(const void *a_buffer, std::uint64_t a_toWrite, std::uint64_t &a_written) const =0
virtual ErrorCode DoSetEndOfStream()
Definition: BSTSmartPointer.h:36
ErrorCode
Definition: ErrorCodes.h:8
SeekMode
Definition: Stream.h:14
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_BSResource__Stream(690344, 398199, 0x1f60350)