4 #include "zipios++/zipios-config.h"
7 #include "zipios++/fcoll.h"
8 #include "zipios++/basicentry.h"
9 #include "zipios++/filepath.h"
13 /** DirEntry is a BasicEntry. */
14 typedef BasicEntry DirEntry ;
16 /** \anchor dircol_anchor
17 DirectoryCollection is a FileCollection that obtains its entries
19 class DirectoryCollection : public FileCollection {
22 /** Default Constructor. */
23 explicit DirectoryCollection()
24 : _entries_loaded( false ), _recursive( true ) {}
28 @param path A directory path name. If the name is not a valid
29 directory the created DirectoryCollection will be invalid.
30 @param load_now Load directory into memory now. Otherwise it will
31 be done when it is first needed.
33 explicit DirectoryCollection( const string &path,
34 bool recursive = true,
35 bool load_now = false ) ;
37 /* Default Copy constructor and copy assignment operator are sufficient. */
39 virtual void close() ;
41 virtual ConstEntries entries() const ;
43 virtual ConstEntryPointer getEntry( const string &name,
44 MatchPath matchpath = MATCH ) const ;
46 virtual istream *getInputStream( const ConstEntryPointer &entry ) ;
48 virtual istream *getInputStream( const string &entry_name,
49 MatchPath matchpath = MATCH ) ;
51 virtual int size() const ;
53 virtual FileCollection *clone() const ;
56 virtual ~DirectoryCollection() ;
59 mutable bool _entries_loaded ;
60 bool _recursive ; // recurse into subdirs.
63 void loadEntries() const ;
64 void load( bool recursive, const FilePath &subdir = FilePath() ) ;
73 Header file that defines DirectoryCollection.
77 Zipios++ - a small C++ library that provides easy access to .zip files.
78 Copyright (C) 2000 Thomas Søndergaard
80 This library is free software; you can redistribute it and/or
81 modify it under the terms of the GNU Lesser General Public
82 License as published by the Free Software Foundation; either
83 version 2 of the License, or (at your option) any later version.
85 This library is distributed in the hope that it will be useful,
86 but WITHOUT ANY WARRANTY; without even the implied warranty of
87 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
88 Lesser General Public License for more details.
90 You should have received a copy of the GNU Lesser General Public
91 License along with this library; if not, write to the Free Software
92 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA