#include <finfo.hpp>
Inner Type Index: | |
struct | DirectorySums |
struct | EIDirectory |
struct | EISymLinkDir |
struct | EISymLinkFile |
struct | ExtendedEntryInfo |
struct | InfoBox |
Public Type Index: | |
enum class | Permissions : int32_t { NONE = 0 , UNKNOWN = 0xFFFF , 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 } |
enum class | Qualities { 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 |
enum class | Types : int8_t { DIRECTORY = 0 , SYMBOLIC_LINK_DIR = 1 , REGULAR = 2 , SYMBOLIC_LINK = 3 , BLOCK = 4 , CHARACTER = 5 , FIFO = 6 , SOCKET = 7 , MARKER_TYPES_END = 8 , UNKNOWN_OR_ERROR = 8 } |
Public Static Field Index: | |
static constexpr TOwnerAndGroupID | UnknownID = (std::numeric_limits<uint32_t>::max)() |
Public Method Index: | |
FInfo () | |
void | AddCustomData (MonoAllocator *monoAllocator, Box data) |
constexpr DateTime | ATime () const noexcept |
constexpr DateTime | CTime () const noexcept |
template<typename T > | |
Box | GetCustomData () |
Box | GetCustomData (int idx) |
constexpr ExtendedEntryInfo * | GetExtendedInfo () const |
CString & | GetLinkTarget () const noexcept |
CString & | 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 | MTime () const noexcept |
constexpr uint32_t | Owner () const noexcept |
constexpr Permissions | Perms () const noexcept |
constexpr Qualities | Quality () const noexcept |
void | SetArtificialFS () noexcept |
void | SetATime (DateTime v) noexcept |
void | SetCrossingFS () noexcept |
void | SetCTime (DateTime v) noexcept |
constexpr void | SetExtendedInfo (ExtendedEntryInfo *extInfo) |
void | SetGroup (uint32_t v) noexcept |
void | SetLinkTarget (const String &target, const String &realTarget) |
void | SetMTime (DateTime v) noexcept |
void | SetOwner (uint32_t v) noexcept |
void | SetPerms (Permissions v) noexcept |
void | SetQuality (Qualities v) noexcept |
void | SetSize (uinteger v) noexcept |
constexpr void | SetSums (const DirectorySums &sums) const |
void | SetTargetArtificialFS () noexcept |
void | SetTargetCrossingFS () noexcept |
void | SetType (Types v) noexcept |
constexpr uinteger | Size () const noexcept |
constexpr DirectorySums & | Sums () const |
constexpr bool | TargetIsArtificialFS () const noexcept |
constexpr bool | TargetIsCrossingFS () const noexcept |
constexpr Types | Type () const noexcept |
AString & | WriteTypeAndAccess (AString &target) const |
using TOwnerAndGroupID = uint32_t |
|
strong |
Permission flags. Compatible with posix* definition.
|
strong |
Per-entry information about how a node was scanned.
Enumerator | |
---|---|
NONE | Node created only from given (real) start path. |
STATS | Only stats (size, time, 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 |
Enumeration of the possible file types. This is compatible with the posix list of types, with the exclamation 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 |
|
staticconstexpr |
|
inline |
|
inline |
This method, together with GetCustomData, provides a simple mechanism to attach some custom information to an entry in FTree.
The allocator of the FTree object has to be provided as a parameter, as it is otherwise not reachable from within this entry object. While this might also be some other, external allocator, it is not easily thinkable of a use case for this.
Note that any object that does not fit as a value into the Box is simply stored as a pointer. No copy is created! Therefore such object has to be allocated persistent. Usually, such objects are created in the same monoAllocator as given, right before the invocation of this method.
monoAllocator | Usually, the allocator of the FTree object that this entry belongs to and as such received with FTree::GetAllocator(). |
data | The data to attach. |
Definition at line 348 of file finfo.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
Alternative version of method GetCustomData(int idx), which searches the attached list of boxes for a first one that contains custom data of type T .
T | The custom type to search for in the attached list of data. |
|
inline |
This method, together with AddCustomData, provides a simple mechanism to attach and retrieve some custom information to an entry in FTree
Custom data is stored in a single-linked list. This class does not provide an iterator for the data, because the application has to assure for itself how many custom data objects are placed in which order! Usually, only one custom object should be stored.
idx | The sequence number of the stored custom boxed element. |
|
inlineconstexpr |
|
inlinenoexcept |
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 486 of file finfo.hpp.
|
inlinenoexcept |
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 500 of file finfo.hpp.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexpr |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexpr |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Writes the file type and the permission flags to the given target string in the same format as GNU/Linux command 'ls -l' does.
target | The target string to write into. |
Definition at line 22 of file finfo.cpp.