Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Archive/Reader.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. 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
10#include "Stroika/Foundation/Containers/Set.h"
12
13/**
14 * \file
15 *
16 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
17 */
18
19namespace Stroika::Foundation::DataExchange::Archive::Reader {
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 IRep;
29
30 class Ptr {
31 public:
32 Ptr () = delete;
33 Ptr (const Ptr&) = delete;
34 Ptr (Ptr&& src);
35 explicit Ptr (const shared_ptr<IRep>& rep);
36 Ptr& operator= (const Ptr&) = delete;
37
38 public:
39 /**
40 */
41 nonvirtual Set<String> GetContainedFiles () const;
42
43 public:
44 /**
45 * maybe define iterator/indexes and maybe have return stream
46 */
47 nonvirtual BLOB GetData (const String& fileName) const;
48
49 protected:
50 nonvirtual const IRep& _ConstGetRep () const;
51
52 private:
53 shared_ptr<IRep> fRep_;
54 };
55
56 /**
57 */
58 class IRep {
59 public:
60 virtual ~IRep () = default;
61 virtual Set<String> GetContainedFiles () const = 0;
62 virtual BLOB GetData (const String& fileName) const = 0;
63 };
64
65}
66
67/*
68 ********************************************************************************
69 ***************************** Implementation Details ***************************
70 ********************************************************************************
71 */
72#include "Reader.inl"
73
74#endif /*_Stroika_Foundation_DataExchange_Archive_Reader_h_*/