zipios 2.2.0
Zipios -- a small C++ library that provides easy access to .zip files.
directoryentry.cpp
Go to the documentation of this file.
1/*
2 Zipios -- a small C++ library that provides easy access to .zip files.
3
4 Copyright (C) 2000-2007 Thomas Sondergaard
5 Copyright (C) 2015-2019 Made to Order Software Corporation
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
30
32
33#include "zipios_common.hpp"
34
35
36namespace zipios
37{
38
58DirectoryEntry::DirectoryEntry(FilePath const & filename, std::string const & comment)
59 : FileEntry(filename, comment)
60{
62 if(m_valid)
63 {
66 }
67}
68
69
81{
83}
84
85
93{
94}
95
96
110bool DirectoryEntry::isEqual(FileEntry const & file_entry) const
111{
112 DirectoryEntry const * const de(dynamic_cast<DirectoryEntry const * const>(&file_entry));
113 if(de == nullptr)
114 {
115 return false;
116 }
117 return FileEntry::isEqual(file_entry);
118}
119
120
121} // zipios namespace
122
123// Local Variables:
124// mode: cpp
125// indent-tabs-mode: nil
126// c-basic-offset: 4
127// tab-width: 4
128// End:
129
130// vim: ts=4 sw=4 et
A file entry that does not use compression.
virtual ~DirectoryEntry() override
Clean up a DirectoryEntry object.
virtual pointer_t clone() const override
Create a copy of the DirectoryEntry.
virtual bool isEqual(FileEntry const &file_entry) const override
Compare two file entries for equality.
DirectoryEntry(FilePath const &filename, std::string const &comment=std::string())
Initialize a DirectoryEntry object.
A FileEntry represents an entry in a FileCollection.
Definition fileentry.hpp:76
std::shared_ptr< FileEntry > pointer_t
Definition fileentry.hpp:78
size_t m_uncompressed_size
virtual bool isEqual(FileEntry const &file_entry) const
Compare two file entries for equality.
Handle a file path and name and its statistics.
Definition filepath.hpp:47
bool isDirectory() const
Check whether the file is a directory.
Definition filepath.cpp:388
std::time_t lastModificationTime() const
Get the last modification time of the file.
Definition filepath.cpp:487
size_t fileSize() const
Get the size of the file.
Definition filepath.cpp:470
bool isRegular() const
Check whether the file is a regular file.
Definition filepath.cpp:374
Define the zipios::DirectoryEntry class.
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.