5#ifndef PT_SYSTEM_TAR_ENTRY_H
6#define PT_SYSTEM_TAR_ENTRY_H
8#include <Pt/System/Api.h>
9#include <Pt/System/FileInfo.h>
10#include <Pt/System/Path.h>
11#include <Pt/DateTime.h>
122 {
return _avail == _remaining; }
160 {
return _linkTarget; }
168 {
return _permissions; }
193 {
return _ownerName; }
209 {
return _groupName; }
232 { _linkTarget = target; }
257 { _ownerName = name; }
272 { _groupName = name; }
280 void setContent(
const char*
data, std::size_t
avail, std::size_t remaining)
284 _remaining = remaining;
294 std::size_t _size = 0;
295 std::size_t _remaining = 0;
296 std::size_t _avail = 0;
297 const char* _data = 0;
Combined Date and Time value.
Definition DateTime.h:66
Unicode capable basic_string.
Definition Api-String.h:67
Perms
File permission flags.
Definition FileInfo.h:117
@ NoPerms
No permissions.
Definition FileInfo.h:118
Represents a path in the file-system.
Definition Path.h:48
TarEntry & operator=(TarEntry &&)=default
Move assignment.
void setPath(const Pt::System::Path &path)
Sets the archive path.
Definition TarEntry.h:213
Type
Kind of archive member.
Definition TarEntry.h:77
@ Directory
Directory.
Definition TarEntry.h:80
@ File
Regular file.
Definition TarEntry.h:79
@ Link
Symbolic link.
Definition TarEntry.h:81
@ Hardlink
Hard link.
Definition TarEntry.h:82
@ Invalid
Not set.
Definition TarEntry.h:78
const Pt::String & ownerName() const
Returns the owner name.
Definition TarEntry.h:192
void setPermissions(Pt::System::FileInfo::Perms permissions)
Sets the POSIX permission bits.
Definition TarEntry.h:236
void setOwnerName(const Pt::String &name)
Sets the owner name.
Definition TarEntry.h:256
const Pt::System::Path & path() const
Returns the archive path.
Definition TarEntry.h:126
void setSize(std::size_t size)
Sets the content length declared in the header.
Definition TarEntry.h:221
const Pt::String & groupName() const
Returns the group name.
Definition TarEntry.h:208
void setType(Type type)
Sets the member kind.
Definition TarEntry.h:226
Pt::uint32_t ownerId() const
Returns the numeric owner id.
Definition TarEntry.h:184
const Pt::System::Path & linkTarget() const
Returns the target of a symbolic link or a hard link.
Definition TarEntry.h:159
void setOwnerId(Pt::uint32_t id)
Sets the numeric owner id.
Definition TarEntry.h:248
void setGroupId(Pt::uint32_t id)
Sets the numeric group id.
Definition TarEntry.h:263
void setLinkTarget(const Pt::System::Path &target)
Sets the target of a symbolic link or a hard link.
Definition TarEntry.h:231
void setGroupName(const Pt::String &name)
Sets the group name.
Definition TarEntry.h:271
Pt::System::FileInfo::Perms permissions() const
Returns the POSIX permission bits.
Definition TarEntry.h:167
const char * data() const
Returns the current content chunk of avail() bytes.
Definition TarEntry.h:147
Pt::uint32_t groupId() const
Returns the numeric group id.
Definition TarEntry.h:200
void setMtime(const Pt::DateTime &mtime)
Sets the modification time in UTC.
Definition TarEntry.h:241
const Pt::DateTime & mtime() const
Returns the modification time in UTC.
Definition TarEntry.h:176
TarEntry()=default
Creates an entry with no metadata and an empty content window.
void clear()
Resets every field to the default-constructed state.
Definition TarEntry.h:111
TarEntry(TarEntry &&)=default
Move constructor.
bool isEnd() const
Returns true when every content byte has been delivered.
Definition TarEntry.h:121
std::size_t avail() const
Returns the number of bytes readable at data().
Definition TarEntry.h:138
std::size_t size() const
Returns the content length declared in the archive header.
Definition TarEntry.h:131
Type type() const
Returns the member kind.
Definition TarEntry.h:152
~TarEntry()=default
Destructor.
static const Pt::uint32_t NoId
Id value meaning that no numeric id is set.
Definition TarEntry.h:90
uint_type uint32_t
Unsigned 32-bit integer type.
Definition Api-Types.h:52
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33