29#ifndef PT_SYSTEM_TAR_ENTRY_H
30#define PT_SYSTEM_TAR_ENTRY_H
32#include <Pt/System/Api.h>
33#include <Pt/System/FileInfo.h>
34#include <Pt/System/Path.h>
35#include <Pt/DateTime.h>
102 {
return _avail == _remaining; }
117 {
return _remaining; }
140 {
return _linkTarget; }
145 {
return _permissions; }
180 { _linkTarget = target; }
185 { _permissions = p; }
199 std::size_t _size = 0;
200 std::size_t _remaining = 0;
201 std::size_t _avail = 0;
202 const char* _data = 0;
Combined Date and Time value.
Definition DateTime.h:66
Perms
File permission flags.
Definition FileInfo.h:117
Represents a path in the file-system.
Definition Path.h:48
Represents a single entry returned by TarReader.
Definition TarEntry.h:62
TarEntry & operator=(TarEntry &&)=default
Move assignment.
void setPath(const Pt::System::Path &path)
Sets the archive path.
Definition TarEntry.h:154
Type
Entry type in the tar archive.
Definition TarEntry.h:67
@ Directory
Directory.
Definition TarEntry.h:70
@ File
Regular file.
Definition TarEntry.h:69
@ Link
Symbolic link.
Definition TarEntry.h:71
@ Hardlink
Hard link.
Definition TarEntry.h:72
@ Invalid
Not yet set.
Definition TarEntry.h:68
void setData(const char *data, std::size_t avail)
Sets the current data chunk pointer and the number of available bytes.
Definition TarEntry.h:169
const Pt::System::Path & path() const
Archive path of this entry (UTF-8 encoded).
Definition TarEntry.h:106
void setSize(std::size_t size)
Sets the total content size in bytes.
Definition TarEntry.h:159
void setType(Type type)
Sets the entry type.
Definition TarEntry.h:174
const Pt::System::Path & linkTarget() const
Target path for symbolic and hard links (UTF-8 encoded).
Definition TarEntry.h:139
void setRemaining(std::size_t remaining)
Sets the number of content bytes not yet delivered.
Definition TarEntry.h:164
void setLinkTarget(const Pt::System::Path &target)
Sets the link target path.
Definition TarEntry.h:179
Pt::System::FileInfo::Perms permissions() const
POSIX permission bits for this entry.
Definition TarEntry.h:144
void setPermissions(Pt::System::FileInfo::Perms p)
Sets the POSIX permission bits.
Definition TarEntry.h:184
const char * data() const
Pointer to the current content chunk of avail() bytes.
Definition TarEntry.h:129
void setMtime(const Pt::DateTime &mtime)
Sets the modification time.
Definition TarEntry.h:189
std::size_t remaining() const
Content bytes not yet delivered by TarReader::advance().
Definition TarEntry.h:116
const Pt::DateTime & mtime() const
Last modification time of this entry.
Definition TarEntry.h:149
TarEntry()=default
Default constructor.
void clear()
Resets all fields to their default values.
Definition TarEntry.h:93
TarEntry(TarEntry &&)=default
Move constructor.
bool isEnd() const
Returns true when the entire content has been delivered.
Definition TarEntry.h:101
std::size_t avail() const
Number of bytes readable at the current data() pointer.
Definition TarEntry.h:121
std::size_t size() const
Total content size in bytes as stored in the archive header.
Definition TarEntry.h:111
Type type() const
Type of this archive entry (file, directory, link, or hard link).
Definition TarEntry.h:134
~TarEntry()=default
Destructor.
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33