60 for(
auto it = collections.begin(); it != collections.end(); ++it)
62 cep = (*it)->getEntry(name, matchpath);
65 file_collection = *it;
70 file_collection.reset();
203 if(
this == &collection || !collection.
isValid())
238 if(collection ==
nullptr)
241 throw InvalidException(
"CollectionCollection::addCollection(): called with a null collection pointer");
300 all_entries += (*it)->entries();
349 matchEntry(
m_collections, name, cep, file_colection, matchpath);
391 matchEntry(
m_collections, entry_name, cep, file_collection, matchpath);
393 return cep ? file_collection->getInputStream(entry_name) :
nullptr;
441 (*it)->mustBeValid();
A collection of collections.
bool addCollection(FileCollection const &collection)
Add a FileCollection to this CollectionCollection.
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.
CollectionCollection & operator=(CollectionCollection const &src)
Copy assignment operator.
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.
bool isValid() const
Check whether the current collection is valid.
std::shared_ptr< FileCollection > pointer_t
virtual void mustBeValid() const
Check whether the collection is valid.
std::shared_ptr< std::istream > stream_pointer_t
A shared pointer to an input stream.
std::vector< pointer_t > vector_t
virtual void close()
Close the current FileEntry of this FileCollection.
FileCollection & operator=(FileCollection const &src)
Replace the content of a collection with a copy of another collection.
virtual pointer_t clone() const =0
Create a clone of this object.
std::shared_ptr< FileEntry > pointer_t
std::vector< pointer_t > vector_t
An InvalidException is used when invalid data is provided.
Define the zipios::CollectionCollection class.
void matchEntry(CollectionCollection::vector_t collections, std::string const &name, FileEntry::pointer_t &cep, FileCollection::pointer_t &file_collection, CollectionCollection::MatchPath matchpath)
Search for an entry.
The zipios namespace includes the Zipios library definitions.
Various functions used throughout the library.
Various exceptions used throughout the Zipios library, all based on zipios::Exception.