Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Compression/Reader.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. 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 IRep& _GetRep ();
45 nonvirtual const IRep& _GetRep () const;
46
47 private:
48 shared_ptr<IRep> fRep_;
49 };
50
51 /**
52 */
53 class Reader::IRep {
54 public:
55 virtual ~IRep () = default;
56
57 public:
58 virtual InputStream::Ptr<byte> Compress (const InputStream::Ptr<byte>& src) const = 0;
59
60 public:
61 virtual InputStream::Ptr<byte> Decompress (const InputStream::Ptr<byte>& src) const = 0;
62 };
63}
64
65/*
66 ********************************************************************************
67 ***************************** Implementation Details ***************************
68 ********************************************************************************
69 */
70#include "Reader.inl"
71
72#endif /*_Stroika_Foundation_DataExchange_Compression_Reader_h_*/
InputStream<>::Ptr is Smart pointer (with abstract Rep) class defining the interface to reading from ...