Stroika Library 3.0d20
 
Loading...
Searching...
No Matches
Archive/Reader.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. 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 IRep& _GetRep ();
51 nonvirtual const IRep& _GetRep () const;
52
53 private:
54 shared_ptr<IRep> fRep_;
55 };
56
57 /**
58 */
59 class IRep {
60 public:
61 virtual ~IRep () = default;
62 virtual Set<String> GetContainedFiles () const = 0;
63 virtual BLOB GetData (const String& fileName) const = 0;
64 };
65
66}
67
68/*
69 ********************************************************************************
70 ***************************** Implementation Details ***************************
71 ********************************************************************************
72 */
73#include "Reader.inl"
74
75#endif /*_Stroika_Foundation_DataExchange_Archive_Reader_h_*/