Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Compression/Reader.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_Compression_Reader_h_
5#define _Stroika_Foundation_DataExchange_Compression_Reader_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
10
11// FILE DEPRECATED!!!
12/// FILE DEPRECATED
13
15
16 using namespace Streams;
17 using Memory::BLOB;
18
19 /**
20 * Abstraction for Readers that map files or streams to collections of files, like zip files, tar files, etc.
21 */
22 class Reader {
23 public:
24 class IRep;
25
26 public:
27 Reader () = delete;
28 Reader (const Reader&) = delete;
29 Reader (Reader&& src);
30 Reader& operator= (const Reader&) = delete;
31
32 protected:
33 explicit Reader (const shared_ptr<IRep>& rep);
34
35 public:
36 nonvirtual InputStream::Ptr<byte> Compress (const InputStream::Ptr<byte>& src) const;
37 nonvirtual BLOB Compress (const BLOB& src) const;
38
39 public:
40 nonvirtual InputStream::Ptr<byte> Decompress (const InputStream::Ptr<byte>& src) const;
41 nonvirtual BLOB Decompress (const BLOB& src) const;
42
43 protected:
44 nonvirtual const IRep& _GetRep () const;
45
46 private:
47 shared_ptr<IRep> fRep_;
48 };
49
50 /**
51 */
52 class Reader::IRep {
53 public:
54 virtual ~IRep () = default;
55
56 public:
57 virtual InputStream::Ptr<byte> Compress (const InputStream::Ptr<byte>& src) const = 0;
58
59 public:
60 virtual InputStream::Ptr<byte> Decompress (const InputStream::Ptr<byte>& src) const = 0;
61 };
62}
63
64/*
65 ********************************************************************************
66 ***************************** Implementation Details ***************************
67 ********************************************************************************
68 */
69#include "Reader.inl"
70
71#endif /*_Stroika_Foundation_DataExchange_Compression_Reader_h_*/
InputStream<>::Ptr is Smart pointer (with abstract Rep) class defining the interface to reading from ...