#include <finfo.hpp>
Inner Type Index: | |
struct | Bits |
A bitfield encoding various information. More... | |
struct | DirectorySums |
Recursively accumulated values for directories. More... | |
struct | EIDirectory |
struct | EISymLinkDir |
struct | EISymLinkFile |
struct | ExtendedEntryInfo |
Base type to create pointers to different extended entry information structs. More... | |
Public Type Index: | |
enum class | Permissions : uint32_t { NONE = 0 , UNKNOWN = 010000 , MASK = 07777 , ALL = 0777 , OWNER_READ = 0400 , OWNER_WRITE = 0200 , OWNER_EXEC = 0100 , OWNER_ALL = 0700 , GROUP_READ = 040 , GROUP_WRITE = 020 , GROUP_EXEC = 010 , GROUP_ALL = 070 , OTHERS_READ = 04 , OTHERS_WRITE = 02 , OTHERS_EXEC = 01 , OTHERS_ALL = 07 , SET_UID = 04000 , SET_GID = 02000 , STICKY_BIT = 01000 } |
Permission flags. Compatible with posix* definition. More... | |
enum class | Qualities : uint8_t { NONE = 0 , STATS = 1 , RESOLVED = 2 , MAX_DEPTH_REACHED = 3 , NOT_FOLLOWED = 4 , NOT_CROSSING_FS = 5 , NO_AFS = 6 , RECURSIVE = 7 , NO_ACCESS = 8 , NO_ACCESS_SL = 9 , NO_ACCESS_SL_TARGET =10 , NO_ACCESS_DIR =11 , BROKEN_LINK =12 , CIRCULAR_LINK =13 , DUPLICATE =14 , NOT_EXISTENT =15 , UNKNOWN_ERROR =16 } |
Per-entry information about how a node was scanned. More... | |
enum class | Qualities3Letters : uint8_t { NONE = 0 , STATS = 1 , RESOLVED = 2 , MAX_DEPTH_REACHED = 3 , NOT_FOLLOWED = 4 , NOT_CROSSING_FS = 5 , NO_AFS = 6 , RECURSIVE = 7 , NO_ACCESS = 8 , NO_ACCESS_SL = 9 , NO_ACCESS_SL_TARGET =10 , NO_ACCESS_DIR =11 , BROKEN_LINK =12 , CIRCULAR_LINK =13 , DUPLICATE =14 , NOT_EXISTENT =15 , UNKNOWN_ERROR =16 } |
using | TOwnerAndGroupID = uint32_t |
Type definition for owner and group ids. | |
enum class | TypeNames1Letter : uint8_t { DIRECTORY = 0 , SYMBOLIC_LINK_DIR = 1 , REGULAR = 2 , SYMBOLIC_LINK = 3 , BLOCK = 4 , CHARACTER = 5 , FIFO = 6 , SOCKET = 7 } |
enum class | TypeNames2Letters : uint8_t { DIRECTORY = 0 , SYMBOLIC_LINK_DIR = 1 , REGULAR = 2 , SYMBOLIC_LINK = 3 , BLOCK = 4 , CHARACTER = 5 , FIFO = 6 , SOCKET = 7 } |
enum class | TypeNames3Letters : uint8_t { DIRECTORY = 0 , SYMBOLIC_LINK_DIR = 1 , REGULAR = 2 , SYMBOLIC_LINK = 3 , BLOCK = 4 , CHARACTER = 5 , FIFO = 6 , SOCKET = 7 } |
enum class | Types : uint8_t { DIRECTORY = 0 , SYMBOLIC_LINK_DIR = 1 , REGULAR = 2 , SYMBOLIC_LINK = 3 , BLOCK = 4 , CHARACTER = 5 , FIFO = 6 , SOCKET = 7 , UNKNOWN_OR_ERROR = 8 , MARKER_TYPES_END = 9 } |
Public Static Field Index: | |
static constexpr TOwnerAndGroupID | UnknownID = (std::numeric_limits<uint32_t>::max)() |
Constant value for owner and group IDs to denote that the field was not determined. | |
Public Method Index: | |
constexpr DateTime | ADate () const noexcept |
constexpr DateTime | BDate () const noexcept |
constexpr DateTime | CDate () const noexcept |
constexpr ExtendedEntryInfo * | GetExtendedInfo () const |
lang::system::CPathString & | GetLinkTarget () const noexcept |
lang::system::CPathString & | GetRealLinkTarget () const noexcept |
constexpr uint32_t | Group () const noexcept |
constexpr bool | IsArtificialFS () const noexcept |
constexpr bool | IsCrossingFS () const noexcept |
constexpr bool | IsDirectory () const noexcept |
constexpr bool | IsSymbolicLink () const noexcept |
constexpr DateTime | MDate () const noexcept |
constexpr uint32_t | Owner () const noexcept |
constexpr Permissions | Perms () const noexcept |
constexpr uint32_t | QtyHardLinks () const noexcept |
constexpr Qualities | Quality () const noexcept |
void | SetADate (DateTime v) noexcept |
Sets the time of last access of this file/folder. | |
void | SetArtificialFS () noexcept |
Mark the entry as residing on an artificial filesystem. | |
void | SetBDate (DateTime v) noexcept |
Sets the birth date of this file/folder. | |
void | SetCDate (DateTime v) noexcept |
Sets the change date of this file/folder. | |
void | SetCrossingFS () noexcept |
Mark the entry as residing on a different filesystem than its parent. | |
constexpr void | SetExtendedInfo (ExtendedEntryInfo *extInfo) |
void | SetGroup (uint32_t v) noexcept |
Sets the ID of the group of the file/folder. | |
void | SetLinkTarget (FTree &tree, const lang::system::PathString &target, const lang::system::PathString &realTarget) |
void | SetMDate (DateTime v) noexcept |
Sets the last modification date of this file/folder. | |
void | SetOwner (uint32_t v) noexcept |
Sets the ID of the owner of the file/folder. | |
void | SetPerms (Permissions v) noexcept |
Sets the permissions of the entry. | |
void | SetQtyHardlinks (uint32_t v) noexcept |
Sets the number of hard links that point to this file. | |
void | SetQuality (Qualities v) noexcept |
Sets the quality of scan of the entry. | |
void | SetSize (uinteger v) noexcept |
Sets the file size. | |
constexpr void | SetSums (const DirectorySums &sums) const |
void | SetTargetArtificialFS () noexcept |
Mark the entry as a symlink who's target is residing on an artificial filesystem. | |
void | SetTargetCrossingFS () noexcept |
Mark the entry as a symlink who's target is residing on a different filesystem than the symlink. | |
void | SetType (Types v) noexcept |
Sets the type of the entry. | |
constexpr uinteger | Size () const noexcept |
constexpr DirectorySums & | Sums () const |
constexpr bool | TargetIsArtificialFS () const noexcept |
constexpr bool | TargetIsCrossingFS () const noexcept |
constexpr Types | Type () const noexcept |
Protected Field Index: | |
DateTime | aDate |
DateTime | bDate |
Bits | bits |
A bitfield encoding various information. | |
DateTime | cDate |
void * | custom = nullptr |
Pool-allocated custom data. | |
const std::type_info * | dbgCustomType = nullptr |
The custom type attached. Used for asserting misuse in debug-compilations. | |
ExtendedEntryInfo * | extendedInfo = nullptr |
Extended information, depending on the entry type. | |
uint32_t | group |
The group id that owns the file. | |
DateTime | mDate |
uint32_t | owner |
The user id that owns the file. | |
uint32_t | qtyHardLinks |
The number of hard links to the file. | |
uinteger | size |
The file size. In case of a directory, this is 0 . | |
|
friend |
|
friend |
using TOwnerAndGroupID = uint32_t |
|
strong |
Permission flags. Compatible with posix* definition.
Enumerator | |
---|---|
NONE | no permission bits are set |
UNKNOWN | Unknown permissions (e.g., when not read, or filesystem does not support permissions) |
MASK | All valid permission bits. Equivalent to all | set_uid | set_gid | sticky_bit. |
ALL | All users have read, write, and execute/search permissions Equivalent to owner_all | group_all | others_all. |
OWNER_WRITE | < S_IRUSR File owner has read permission |
OWNER_EXEC | < S_IWUSR File owner has write permission |
OWNER_ALL | < S_IXUSR File owner has execute/search permission |
GROUP_READ | < S_IRWXU File owner has read, write, and execute/search permissions Equivalent to owner_read | owner_write | owner_exec |
GROUP_WRITE | < S_IRGRP The file's user group has read permission |
GROUP_EXEC | < S_IWGRP The file's user group has write permission |
GROUP_ALL | < S_IXGRP The file's user group has execute/search permission |
OTHERS_READ | < S_IRWXG The file's user group has read, write, and execute/search permissions Equivalent to group_read | group_write | group_exec S_IROTH Other users have read permission |
OTHERS_WRITE | S_IWOTH Other users have write permission. |
OTHERS_EXEC | S_IXOTH Other users have execute/search permission. |
OTHERS_ALL | S_IRWXO Other users have read, write, and execute/search permissions Equivalent to others_read | others_write | others_exec. |
SET_UID | S_ISUID Set user ID to file owner user ID on execution. |
SET_GID | S_ISGID Set group ID to file's user group ID on execution. |
STICKY_BIT | S_ISVTX Implementation-defined meaning, but POSIX XSI specifies that when set on a directory, only file owners may delete files even if the directory is writeable to others (used with /tmp) |
|
strong |
Per-entry information about how a node was scanned.
Enumerator | |
---|---|
NONE | Node created only from given (real) start path. |
STATS | Only stats (size, date, owner, etc.) read. |
RESOLVED | Read symlink target strings. |
MAX_DEPTH_REACHED | Scanner stopped, because maximum depth was reached. |
NOT_FOLLOWED | A symbolic link that targets a directory, but scan parameters specify not to follow. |
NOT_CROSSING_FS | A directory that represented a mounted filesystem was not followed due to field. |
NO_AFS | A directory that represented a mounted filesystem was not followed due to field ScanParameters::CrossFileSystems being set to |
RECURSIVE | Follow symlink target strings. |
NO_ACCESS | Scanner failure due to limited access rights. |
NO_ACCESS_SL | Scanner failure due to limited access rights. |
NO_ACCESS_SL_TARGET | Scanner failure due to limited access rights. |
NO_ACCESS_DIR | Scanner failure due to limited access rights. |
BROKEN_LINK | A symbolic link targets a non-existent file or directory. |
CIRCULAR_LINK | Set if recursion stopped on a symbolic link which was identified by the operating system as a circular link. |
DUPLICATE | Set if recursion stopped on a symbolic link who's target had been scanned already. This might happen either because the path was already scanned by another search, or because a symbolic link is circular or because of a mixture of both. Thus, this can indicate a circular link, but does not have to. |
NOT_EXISTENT | Set if a given start path does not exist. |
UNKNOWN_ERROR | Unknown scanner failure. |
|
strong |
This is a resourced enumeration that is equivalent to enum class Qualities but uses a 3-Letter code when serialized.
Enumerator | |
---|---|
NONE | NON: Node created only from given (real) start path. |
STATS | STA: Only stats (size, date, owner, etc.) read. |
RESOLVED | RES: Read symlink target strings. |
MAX_DEPTH_REACHED | MDR:Scanner stopped, because maximum depth was reached. |
NOT_FOLLOWED | NFO:A symbolic link that targets a directory, but scan parameters specify not to follow. |
NOT_CROSSING_FS | NCF:A directory that represented a mounted filesystem was not followed due to field. |
NO_AFS | ScanParameters::CrossFileSystems being set to NAF:A directory that represented a mounted filesystem was not followed due to field |
RECURSIVE | REC:Follow symlink target strings. |
NO_ACCESS | NAC: Scanner failure due to limited access rights. |
NO_ACCESS_SL | NSL: Scanner failure due to limited access rights. |
NO_ACCESS_SL_TARGET | NAT: Scanner failure due to limited access rights. |
NO_ACCESS_DIR | NAD: Scanner failure due to limited access rights. |
BROKEN_LINK | BRL: A symbolic link targets a non-existent file or directory. |
CIRCULAR_LINK | operating system as a circular link. CIL: Set if recursion stopped on a symbolic link which was identified by the |
DUPLICATE | DUP: Set if recursion stopped on a symbolic link who's target had been scanned already. This might happen either because the path was already scanned by another search, or because a symbolic link is circular or because of a mixture of both. Thus, this can indicate a circular link, but does not have to. |
NOT_EXISTENT | NEX: Set if a given start path does not exist. |
UNKNOWN_ERROR | UKE: Unknown scanner failure. |
|
strong |
This is a resourced enumeration that is equivalent to enum class Types but uses a 1-Letter code when serialized. The symbols are taken from GNU/Linux command 'ls -l'
, except special type SYMBOLIC_LINK_DIR which uses an upper case 'L'
in contrast to the lower case 'l'
used with links to files.
|
strong |
This is a resourced enumeration that is equivalent to enum class Types but uses a 2-Letter code when serialized.
|
strong |
This is a resourced enumeration that is equivalent to enum class Types but uses a 3-Letter code when serialized.
|
strong |
Enumeration of the possible file types. This is compatible with the posix list of types, with the exception that symbolic links are differentiated between those linking to a directory and those linking to any other file type.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticconstexpr |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexpr |
|
inlinenodiscardnoexcept |
Retrieves the non-translated target of a symbolic link. In debug compilations, the method asserts that Type returns either Types::SYMBOLIC_LINK or Types::SYMBOLIC_LINK_DIR.
Definition at line 482 of file finfo.hpp.
|
inlinenodiscardnoexcept |
Retrieves the resolved target of a symbolic link. In debug compilations, the method asserts that Type returns either Types::SYMBOLIC_LINK or Types::SYMBOLIC_LINK_DIR.
Definition at line 496 of file finfo.hpp.
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenoexcept |
Sets the time of last access of this file/folder.
v | The value to set. |
|
inlinenoexcept |
|
inlinenoexcept |
Sets the birth date of this file/folder.
v | The value to set. |
|
inlinenoexcept |
Sets the change date of this file/folder.
v | The value to set. |
|
inlinenoexcept |
|
inlineconstexpr |
Sets the extended information object. As with all set functions, this method should only be used from certain code entities, like file scanners. If used, the object passed here has to be pool-allocated using public instance FTree::Pool. The object will be freed with the deletion of the corresponding string tree node (respectively File instance).
extInfo | A pointer to the information object to use. |
|
inlinenoexcept |
void SetLinkTarget | ( | FTree & | tree, |
const lang::system::PathString & | target, | ||
const lang::system::PathString & | realTarget ) |
Stores the link targets in the extended information object created for symbolic links.
tree | The tree that this object belongs to. |
target | The target as stored in the symlink |
realTarget | The translated, 'real' target path (if not broken). |
Definition at line 23 of file finfo.cpp.
|
inlinenoexcept |
Sets the last modification date of this file/folder.
v | The value to set. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexpr |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexpr |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |