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())
241 throw InvalidException(
"CollectionCollection::addCollection(): called with a null collection pointer");
300 all_entries += (*it)->entries();
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.
std::shared_ptr< FileCollection > pointer_t
Various exceptions used throughout the Zipios++ library, all based on zipios::Exception.
virtual size_t size() const override
Return the size of the of this collection.
virtual ~CollectionCollection() override
Clean up this CollectionCollection object.
virtual void close() override
Close the CollectionCollection object.
virtual stream_pointer_t getInputStream(std::string const &entry_name, MatchPath matchpath=MatchPath::MATCH) override
Retrieve pointer to an istream.
CollectionCollection & operator=(CollectionCollection const &src)
Copy assignment operator.
virtual pointer_t clone() const =0
Create a clone of this object.
std::shared_ptr< std::istream > stream_pointer_t
A shared pointer to an input stream.
std::vector< pointer_t > vector_t
void matchEntry(CollectionCollection::vector_t collections, std::string const &name, FileEntry::pointer_t &cep, FileCollection::pointer_t &file_collection, CollectionCollection::MatchPath matchpath)
Seach for an entry.
Define the zipios::CollectionCollection class.
virtual void close()
Close the current FileEntry of this FileCollection.
virtual void mustBeValid() const
Check whether the collection is valid.
FileCollection & operator=(FileCollection const &src)
Replace the content of a collection with a copy of another collection.
CollectionCollection()
Initialize a CollectionCollection object.
virtual void mustBeValid() const
Check whether the collection is valid.
virtual FileEntry::vector_t entries() const override
Retrieve a vector to all the collection entries.
Various functions used throughout the library.
An InvalidException is used when invalid data is provided.
Base class for various file collections.
virtual FileEntry::pointer_t getEntry(std::string const &name, MatchPath matchpath=MatchPath::MATCH) const override
Get an entry from the collection.
virtual pointer_t clone() const override
Create a clone of this object.
bool isValid() const
Check whether the current collection is valid.
std::shared_ptr< FileEntry > pointer_t
std::vector< pointer_t > vector_t