File tree 2 files changed +40
-0
lines changed
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,7 @@ set(SRC_STREAM
582
582
"Stream/FileStreamConcept.cpp"
583
583
"Stream/SeekDirection.h"
584
584
"Stream/SpanStreamConcept.h"
585
+ "Stream/Stream.h"
585
586
"Stream/StreamConcept.h"
586
587
)
587
588
Original file line number Diff line number Diff line change
1
+ //
2
+ // SPDX-License-Identifier: LGPL-2.1-or-later
3
+ //
4
+ // Copyright © 2022 ANSSI. All Rights Reserved.
5
+ //
6
+ // Author(s): fabienfl (ANSSI)
7
+ //
8
+ #pragma once
9
+
10
+ #include < memory>
11
+
12
+ #include " Stream/SeekDirection.h"
13
+ #include " Utils/BufferSpan.h"
14
+ #include " Utils/BufferView.h"
15
+
16
+ //
17
+ // Lightweight stream interface to replace ByteStream
18
+ //
19
+
20
+ namespace Orc {
21
+ namespace Stream {
22
+
23
+ class Stream
24
+ {
25
+ public:
26
+ using Ptr = std::shared_ptr<Stream>;
27
+
28
+ virtual ~Stream () {}
29
+
30
+ virtual size_t Read (BufferSpan output, std::error_code& ec) = 0;
31
+ virtual size_t Write (BufferView& input, std::error_code& ec) = 0;
32
+ virtual uint64_t Seek (SeekDirection direction, int64_t value, std::error_code& ec) = 0;
33
+ };
34
+
35
+ } // namespace Stream
36
+
37
+ using Stream = Stream::Stream;
38
+
39
+ } // namespace Orc
You can’t perform that action at this time.
0 commit comments