C++ Crashkurs
File Entry. More...
#include <utils/tar.h>
Public Member Functions | |
| uint64_t | getSize () |
| Get file size. | |
| bool | isUstar () |
| Entry with Ustar extension? | |
| bool | isValid () |
| Valid checksum? | |
| void * | getData () |
| Get pointer to file data. | |
| File * | next () |
| Get a pointer to the next file entry. | |
Public Attributes | |
| char | name [100] |
| File name ('\0' terminated string) | |
| char | mode [8] |
| Permission bits (octal characters) | |
| char | uid [8] |
| User ID (octal characters) | |
| char | gid [8] |
| Group ID (octal characters) | |
| char | size [12] |
| File size (octal characters) | |
| char | mtime [12] |
| Timestamp of last modification (octal characters) | |
| char | checksum [8] |
| check sum (octal characters) | |
| Type | type |
| File type. | |
| char | link [100] |
| File name with identical content for TYPE_HARD_LINK. | |
| char | magic [8] |
| Magic header "ustar". | |
| char | user [32] |
| User. | |
| char | group [32] |
| Group. | |
| char | majordevid [8] |
| Major device ID. | |
| char | minordevid [8] |
| Minor device ID. | |
| char | prefix [155] |
| File prefix. | |
| char | padding [12] |
| Padding (unused) | |
| char | data [] |
| File contents with size bytes, 512 bytes aligned. | |
Detailed Description
File Entry.
Contains 512 bytes of meta information as well as the content of the file with a variable size (512 bytes aligned).
Numbers are encoded as zero-filled octal numbers in ASCII characters.
Member Function Documentation
| uint64_t Tar::File::getSize | ( | ) |
Get file size.
- Returns
- Size of actual file (without padding)
| bool Tar::File::isUstar | ( | ) |
Entry with Ustar extension?
- Returns
- 'true' if entry uses the extension
| bool Tar::File::isValid | ( | ) |
Valid checksum?
- Returns
- 'true' if header has a correct checksum
| void * Tar::File::getData | ( | ) |
Get pointer to file data.
- Returns
- Pointer to file data (use getSize() for length)
| Tar::File * Tar::File::next | ( | ) |
Get a pointer to the next file entry.
- Returns
- Pointer to next file entry or 'nullptr' if there is none.
Member Data Documentation
| char Tar::File::name[100] |
File name ('\0' terminated string)
| char Tar::File::mode[8] |
Permission bits (octal characters)
| char Tar::File::uid[8] |
User ID (octal characters)
| char Tar::File::gid[8] |
Group ID (octal characters)
| char Tar::File::size[12] |
File size (octal characters)
| char Tar::File::mtime[12] |
Timestamp of last modification (octal characters)
| char Tar::File::checksum[8] |
check sum (octal characters)
| Type Tar::File::type |
File type.
| char Tar::File::link[100] |
File name with identical content for TYPE_HARD_LINK.
| char Tar::File::magic[8] |
Magic header "ustar".
| char Tar::File::user[32] |
User.
| char Tar::File::group[32] |
Group.
| char Tar::File::majordevid[8] |
Major device ID.
| char Tar::File::minordevid[8] |
Minor device ID.
| char Tar::File::prefix[155] |
File prefix.
| char Tar::File::padding[12] |
Padding (unused)
| char Tar::File::data[] |
File contents with size bytes, 512 bytes aligned.
The documentation for this struct was generated from the following files: