| 1 | // | 
|---|
| 2 | // ArchiveEntry.cpp | 
|---|
| 3 | // | 
|---|
| 4 | // Library: SevenZip | 
|---|
| 5 | // Package: Archive | 
|---|
| 6 | // Module:  ArchiveEntry | 
|---|
| 7 | // | 
|---|
| 8 | // Copyright (c) 2014, Applied Informatics Software Engineering GmbH. | 
|---|
| 9 | // and Contributors. | 
|---|
| 10 | // | 
|---|
| 11 | // SPDX-License-Identifier:	BSL-1.0 | 
|---|
| 12 | // | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 | #include "Poco/SevenZip/ArchiveEntry.h" | 
|---|
| 16 | #include <algorithm> | 
|---|
| 17 |  | 
|---|
| 18 |  | 
|---|
| 19 | namespace Poco { | 
|---|
| 20 | namespace SevenZip { | 
|---|
| 21 |  | 
|---|
| 22 |  | 
|---|
| 23 | ArchiveEntry::ArchiveEntry(): | 
|---|
| 24 | _type(ENTRY_FILE), | 
|---|
| 25 | _size(0), | 
|---|
| 26 | _lastModified(0), | 
|---|
| 27 | _attributes(0), | 
|---|
| 28 | _index(0) | 
|---|
| 29 | { | 
|---|
| 30 | } | 
|---|
| 31 |  | 
|---|
| 32 |  | 
|---|
| 33 | ArchiveEntry::ArchiveEntry(EntryType type, const std::string& path, Poco::UInt64 size, Poco::Timestamp lastModified, UInt32 attributes, Poco::UInt32 index): | 
|---|
| 34 | _type(type), | 
|---|
| 35 | _path(path), | 
|---|
| 36 | _size(size), | 
|---|
| 37 | _lastModified(lastModified), | 
|---|
| 38 | _attributes(attributes), | 
|---|
| 39 | _index(index) | 
|---|
| 40 | { | 
|---|
| 41 | } | 
|---|
| 42 |  | 
|---|
| 43 |  | 
|---|
| 44 | ArchiveEntry::ArchiveEntry(const ArchiveEntry& entry): | 
|---|
| 45 | _type(entry._type), | 
|---|
| 46 | _path(entry._path), | 
|---|
| 47 | _size(entry._size), | 
|---|
| 48 | _lastModified(entry._lastModified), | 
|---|
| 49 | _attributes(entry._attributes), | 
|---|
| 50 | _index(entry._index) | 
|---|
| 51 | { | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | ArchiveEntry::~ArchiveEntry() | 
|---|
| 56 | { | 
|---|
| 57 | } | 
|---|
| 58 |  | 
|---|
| 59 |  | 
|---|
| 60 | ArchiveEntry& ArchiveEntry::operator = (const ArchiveEntry& entry) | 
|---|
| 61 | { | 
|---|
| 62 | ArchiveEntry temp(entry); | 
|---|
| 63 | swap(temp); | 
|---|
| 64 | return *this; | 
|---|
| 65 | } | 
|---|
| 66 |  | 
|---|
| 67 |  | 
|---|
| 68 | void ArchiveEntry::swap(ArchiveEntry& entry) | 
|---|
| 69 | { | 
|---|
| 70 | std::swap(_type, entry._type); | 
|---|
| 71 | std::swap(_path, entry._path); | 
|---|
| 72 | std::swap(_size, entry._size); | 
|---|
| 73 | _lastModified.swap(entry._lastModified); | 
|---|
| 74 | std::swap(_attributes, entry._attributes); | 
|---|
| 75 | std::swap(_index, entry._index); | 
|---|
| 76 | } | 
|---|
| 77 |  | 
|---|
| 78 |  | 
|---|
| 79 | } } // namespace Poco::SevenZip | 
|---|
| 80 |  | 
|---|