zipios 2.3.4
Zipios -- a small C++ library providing easy access to .zip files.
collectioncollection.hpp
Go to the documentation of this file.
1#pragma once
2#ifndef ZIPIOS_COLLECTIONCOLLECTION_HPP
3#define ZIPIOS_COLLECTIONCOLLECTION_HPP
4
5/*
6 Zipios -- a small C++ library that provides easy access to .zip files.
7
8 Copyright (C) 2000-2007 Thomas Sondergaard
9 Copyright (c) 2015-2022 Made to Order Software Corp. All Rights Reserved
10
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Lesser General Public
13 License as published by the Free Software Foundation; either
14 version 2.1 of the License, or (at your option) any later version.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public
22 License along with this library; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
34
35
36namespace zipios
37{
38
39
41{
42public:
43 explicit CollectionCollection();
45 virtual pointer_t clone() const override;
46 virtual ~CollectionCollection() override;
47
49
50 bool addCollection(FileCollection const & collection);
52 virtual void close() override;
53 virtual FileEntry::vector_t entries() const override;
54 virtual FileEntry::pointer_t getEntry(std::string const & name, MatchPath matchpath = MatchPath::MATCH) const override;
55 virtual stream_pointer_t getInputStream(std::string const & entry_name, MatchPath matchpath = MatchPath::MATCH) override;
56 virtual size_t size() const override;
57 virtual void mustBeValid() const;
58
59protected:
61};
62
63
64} // zipios namespace
65
66// Local Variables:
67// mode: cpp
68// indent-tabs-mode: nil
69// c-basic-offset: 4
70// tab-width: 4
71// End:
72
73// vim: ts=4 sw=4 et
74#endif
A collection of collections.
bool addCollection(FileCollection const &collection)
Add a FileCollection to this CollectionCollection.
CollectionCollection & operator=(CollectionCollection const &rhs)
Copy assignment operator.
virtual ~CollectionCollection() override
Clean up this CollectionCollection object.
virtual void close() override
Close the CollectionCollection object.
virtual void mustBeValid() const
Check whether the collection is valid.
virtual pointer_t clone() const override
Create a clone of this object.
virtual size_t size() const override
Return the size of the of this collection.
virtual stream_pointer_t getInputStream(std::string const &entry_name, MatchPath matchpath=MatchPath::MATCH) override
Retrieve pointer to an istream.
virtual FileEntry::vector_t entries() const override
Retrieve a vector to all the collection entries.
CollectionCollection()
Initialize a CollectionCollection object.
virtual FileEntry::pointer_t getEntry(std::string const &name, MatchPath matchpath=MatchPath::MATCH) const override
Get an entry from the collection.
Base class for various file collections.
std::shared_ptr< FileCollection > pointer_t
std::shared_ptr< std::istream > stream_pointer_t
A shared pointer to an input stream.
std::vector< pointer_t > vector_t
std::shared_ptr< FileEntry > pointer_t
Definition fileentry.hpp:78
std::vector< pointer_t > vector_t
Definition fileentry.hpp:79
Define the zipios::FileCollection class.
The zipios namespace includes the Zipios library definitions.