libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
stream.hxx
1#ifndef art__paperback__carousel__stream_hxx_
2#define art__paperback__carousel__stream_hxx_
3
4#include <art/paperback/types.hxx>
5#include <art/paperback/forward.hxx>
6
7#include <art/paperback/carousel/object-model.hxx>
8
10{
11
12 /// Represents a COS stream.
13 ///
14 class Stream
16 {
17 public:
18 /// Constructor.
19 ///
20 Stream();
21
22 /// Constructor.
23 ///
24 Stream(Stream const&);
25
26 /// Constructor.
27 ///
28 Stream(Stream&&);
29
30 /// Destructor.
31 ///
32 ~Stream() noexcept;
33
34 /// Clear stream.
35 ///
36 void
37 clear();
38
39 /// Returns the stream metadata as a dictionary.
40 ///
42 as_dictionary() const;
43
44 /// Access the buffer as a string.
45 ///
46 string
47 str() const;
48
49 /// Access buffer.
50 ///
51 std::basic_streambuf<char>*
52 rdbuf() const;
53
54 /// Access data stream.
55 ///
56 iostream*
57 operator->();
58
59 /// Access data stream.
60 ///
61 iostream const*
62 operator->() const;
63
64 /// Access data stream.
65 ///
66 iostream&
67 operator*();
68
69 /// Access data stream.
70 ///
71 iostream const&
72 operator*() const;
73
74 /// Assignment.
75 ///
76 Stream&
77 operator=(Stream const&);
78
79 /// Assignment.
80 ///
81 Stream&
83
84 /// Comparison.
85 ///
86 bool
87 operator==(Stream const&) const;
88
89 /// Comparison.
90 ///
91 bool
92 operator!=(Stream const&) const;
93
94 private:
95 struct Internal;
96 unique_ptr<Internal> _internal;
97
98 };
99
100 /// Access stream object.
101 ///
102 iostream&
104
105} // namespace Art::Paperback::Carousel
106
107#endif
Represents a COS dictionary.
Definition dictionary.hxx:17
Base class for value types.
Definition object-model.hxx:295
Represents a COS-file object.
Definition object.hxx:16
Dictionary as_dictionary() const
Returns the stream metadata as a dictionary.
Definition stream.cxx:62
void clear()
Clear stream.
Definition stream.cxx:51
iostream & operator*()
Access data stream.
Definition stream.cxx:112
iostream * operator->()
Access data stream.
Definition stream.cxx:94
Stream()
Constructor.
Definition stream.cxx:27
std::basic_streambuf< char > * rdbuf() const
Access buffer.
Definition stream.cxx:86
~Stream() noexcept
Destructor.
Definition stream.cxx:46
Stream & operator=(Stream const &)
Assignment.
Definition stream.cxx:130
string str() const
Access the buffer as a string.
Definition stream.cxx:79
bool operator==(Stream const &) const
Comparison.
Definition stream.cxx:152
bool operator!=(Stream const &) const
Comparison.
Definition stream.cxx:159
COS file format implementation namespace.
Definition array.cxx:6
iostream & stream_cast(Object &object)
Access stream object.
Definition stream.cxx:168