zipios
2.3.2
Zipios -- a small C++ library that provides easy access to .zip files.
zipios
directorycollection.hpp
Go to the documentation of this file.
1
#pragma once
2
#ifndef ZIPIOS_DIRECTORYCOLLECTION_HPP
3
#define ZIPIOS_DIRECTORYCOLLECTION_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
32
33
#include "
zipios/filecollection.hpp
"
34
#include "
zipios/directoryentry.hpp
"
35
36
37
namespace
zipios
38
{
39
40
41
class
DirectoryCollection
:
public
FileCollection
42
{
43
public
:
44
DirectoryCollection
();
45
DirectoryCollection
(
46
std::string
const
& path
47
,
bool
recursive =
true
);
48
virtual
pointer_t
clone
()
const override
;
49
virtual
~DirectoryCollection
()
override
;
50
51
virtual
void
close
()
override
;
52
virtual
FileEntry::vector_t
entries
()
const override
;
53
virtual
FileEntry::pointer_t
getEntry
(std::string
const
& name,
MatchPath
matchpath =
MatchPath::MATCH
)
const override
;
54
virtual
stream_pointer_t
getInputStream
(std::string
const
& entry_name,
MatchPath
matchpath =
MatchPath::MATCH
)
override
;
55
56
protected
:
57
void
loadEntries
()
const
;
58
void
load
(
FilePath
const
& subdir);
59
60
mutable
bool
m_entries_loaded
=
false
;
61
bool
m_recursive
=
true
;
62
FilePath
m_filepath
;
63
};
64
65
66
}
// zipios namespace
67
68
// Local Variables:
69
// mode: cpp
70
// indent-tabs-mode: nil
71
// c-basic-offset: 4
72
// tab-width: 4
73
// End:
74
75
// vim: ts=4 sw=4 et
76
#endif
zipios::DirectoryCollection::entries
virtual FileEntry::vector_t entries() const override
Retrieve a vector to the collection entries.
Definition
directorycollection.cpp:142
zipios::DirectoryCollection::m_filepath
FilePath m_filepath
Definition
directorycollection.hpp:62
zipios::DirectoryCollection::m_entries_loaded
bool m_entries_loaded
Definition
directorycollection.hpp:60
zipios::DirectoryCollection::load
void load(FilePath const &subdir)
This is the function loading all the file entries.
Definition
directorycollection.cpp:278
zipios::DirectoryCollection::clone
virtual pointer_t clone() const override
Create another DirectoryCollection.
Definition
directorycollection.cpp:223
zipios::DirectoryCollection::m_recursive
bool m_recursive
Definition
directorycollection.hpp:61
zipios::DirectoryCollection::DirectoryCollection
DirectoryCollection()
Initialize a DirectoryCollection object.
Definition
directorycollection.cpp:65
zipios::DirectoryCollection::getInputStream
virtual stream_pointer_t getInputStream(std::string const &entry_name, MatchPath matchpath=MatchPath::MATCH) override
Retrieve pointer to an istream.
Definition
directorycollection.cpp:203
zipios::DirectoryCollection::close
virtual void close() override
Close the directory collection.
Definition
directorycollection.cpp:118
zipios::DirectoryCollection::getEntry
virtual FileEntry::pointer_t getEntry(std::string const &name, MatchPath matchpath=MatchPath::MATCH) const override
Get an entry from the collection.
Definition
directorycollection.cpp:170
zipios::DirectoryCollection::loadEntries
void loadEntries() const
This is an internal function that loads the file entries.
Definition
directorycollection.cpp:236
zipios::FileCollection::MatchPath
MatchPath
Definition
filecollection.hpp:48
zipios::FileCollection::MatchPath::MATCH
@ MATCH
Definition
filecollection.hpp:50
zipios::FileCollection::pointer_t
std::shared_ptr< FileCollection > pointer_t
Definition
filecollection.hpp:43
zipios::FileCollection::stream_pointer_t
std::shared_ptr< std::istream > stream_pointer_t
A shared pointer to an input stream.
Definition
filecollection.hpp:45
zipios::FileCollection::FileCollection
FileCollection(std::string const &filename=std::string())
Initializes a FileCollection object.
Definition
filecollection.cpp:269
zipios::FileEntry::pointer_t
std::shared_ptr< FileEntry > pointer_t
Definition
fileentry.hpp:78
zipios::FileEntry::vector_t
std::vector< pointer_t > vector_t
Definition
fileentry.hpp:79
zipios::FilePath
Handle a file path and name and its statistics.
Definition
filepath.hpp:47
directoryentry.hpp
Define the zipios::DirectoryEntry class.
filecollection.hpp
Define the zipios::FileCollection class.
zipios
The zipios namespace includes the Zipios library definitions.
Definition
backbuffer.cpp:36
Generated on
for zipios by
1.18.0