Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Archive/Reader.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2024. All rights reserved
3 */
4#ifndef _Stroika_Foundation_DataExchange_Archive_Reader_h_
5#define _Stroika_Foundation_DataExchange_Archive_Reader_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
12
13/**
14 * \file
15 *
16 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
17 */
18
19namespace Stroika::Foundation::DataExchange::Archive {
20
21 using Characters::String;
22 using Containers::Set;
23 using Memory::BLOB;
24
25 /**
26 * Abstraction for Readers that map files or streams to collections of files, like zip files, tar files, etc.
27 */
28 class Reader {
29 protected:
30 class _IRep;
31
32 public:
33 Reader () = delete;
34 Reader (const Reader&) = delete;
35 Reader (Reader&& src);
36 Reader& operator= (const Reader&) = delete;
37
38 protected:
39 explicit Reader (const shared_ptr<_IRep>& rep);
40
41 public:
42 /**
43 */
44 nonvirtual Set<String> GetContainedFiles () const;
45
46 public:
47 /**
48 * maybe define iterator/indexes and maybe have return stream
49 */
50 nonvirtual BLOB GetData (const String& fileName) const;
51
52 protected:
53 nonvirtual _IRep& _GetRep ();
54 nonvirtual const _IRep& _GetRep () const;
55
56 private:
57 shared_ptr<_IRep> fRep_;
58 };
59
60 /**
61 */
62 class Reader::_IRep {
63 public:
64 virtual ~_IRep () = default;
65 virtual Set<String> GetContainedFiles () const = 0;
66 virtual BLOB GetData (const String& fileName) const = 0;
67 };
68}
69
70/*
71 ********************************************************************************
72 ***************************** Implementation Details ***************************
73 ********************************************************************************
74 */
75#include "Reader.inl"
76
77#endif /*_Stroika_Foundation_DataExchange_Archive_Reader_h_*/
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
Definition Set.h:105
nonvirtual BLOB GetData(const String &fileName) const