Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Compression/Reader.inl
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4
6
8
9 /*
10 ********************************************************************************
11 ********************* DataExchange::Compression::Reader ************************
12 ********************************************************************************
13 */
14 inline Reader::Reader (const shared_ptr<IRep>& rep)
15 : fRep_{rep}
16 {
17 }
18 inline Reader::Reader (Reader&& src)
19 : fRep_{move (src.fRep_)}
20 {
21 }
22 inline Reader::IRep& Reader::_GetRep ()
23 {
24 EnsureNotNull (fRep_.get ());
25 return *fRep_;
26 }
27 inline const Reader::IRep& Reader::_GetRep () const
28 {
29 EnsureNotNull (fRep_.get ());
30 return *fRep_;
31 }
32 inline InputStream::Ptr<byte> Reader::Compress (const InputStream::Ptr<byte>& src) const
33 {
34 return _GetRep ().Compress (src);
35 }
36 inline BLOB Reader::Compress (const BLOB& src) const
37 {
38 return _GetRep ().Compress (src.As<InputStream::Ptr<byte>> ()).ReadAll ();
39 }
40 inline InputStream::Ptr<byte> Reader::Decompress (const InputStream::Ptr<byte>& src) const
41 {
42 return _GetRep ().Decompress (src);
43 }
44 inline BLOB Reader::Decompress (const BLOB& src) const
45 {
46 return _GetRep ().Decompress (src.As<InputStream::Ptr<byte>> ()).ReadAll ();
47 }
48
49}
#define EnsureNotNull(p)
Definition Assertions.h:340