8#ifndef HPP_ALIB_FILES_FINFO
9#define HPP_ALIB_FILES_FINFO 1
11#if !defined (HPP_ALIB_FILES_CAMP)
15#if !defined(HPP_ALIB_CAMP_MESSAGE_REPORT)
19#if !defined (HPP_ALIB_LANG_SIDILIST)
23#if !defined (HPP_ALIB_TIME_DATETIME)
27#if !defined (HPP_ALIB_ENUMS_ITERABLE)
32namespace alib {
namespace files {
186 return int(type) < 2;
216 "CAMP/FILES",
"Cant get count for file type {!Q}", type )
351 custom.pushFront(infoNode);
370 auto* list=
custom.first();
373 if( list ==
nullptr )
return Box();
374 if( idx == 0 )
return list->data;
393 auto* list=
custom.first();
394 while(list!=
nullptr)
396 if( list->data.IsType<T>() )
409 [[nodiscard]]
constexpr bool IsDirectory () const noexcept {
return (
bits & 0xE) == 0; }
416 [[nodiscard]]
constexpr bool IsArtificialFS () const noexcept {
return (
bits & (uint32_t(1) << 4)) != 0; }
420 [[nodiscard]]
constexpr bool IsCrossingFS () const noexcept {
return (
bits & (uint32_t(1) << 6)) != 0; }
432 [[nodiscard]]
constexpr uint32_t
Owner () const noexcept {
return owner; }
434 [[nodiscard]]
constexpr uint32_t
Group () const noexcept {
return group; }
451 "Requesting sums for FInfo that is not a directory.")
453 "Requesting sums for FInfo that has no sums set. Quality: ",
Quality() )
470 "Given node is not a directory or symbolic link pointing to a directory.")
490 "Given node is not a symbolic link.")
504 "Given node is not a symbolic link.")
uint32_t group
The group id that owns the file.
@ MARKER_TYPES_END
A marker for the last countable type. The rest are unused/errors.
@ DIRECTORY
Directory/folder.
@ CHARACTER
A character special file.
@ BLOCK
A block special file.
@ FIFO
A FIFO (also known as pipe) file.
uint32_t owner
The user id that owns the file.
void SetCTime(DateTime v) noexcept
void SetOwner(uint32_t v) noexcept
constexpr bool IsSymbolicLink() const noexcept
static constexpr TOwnerAndGroupID UnknownID
constexpr DateTime CTime() const noexcept
CString & GetRealLinkTarget() const noexcept
constexpr bool TargetIsArtificialFS() const noexcept
constexpr Permissions Perms() const noexcept
constexpr DateTime ATime() const noexcept
constexpr uint32_t Group() const noexcept
constexpr void SetSums(const DirectorySums &sums) const
void SetTargetArtificialFS() noexcept
uint32_t TOwnerAndGroupID
void SetMTime(DateTime v) noexcept
constexpr void SetExtendedInfo(ExtendedEntryInfo *extInfo)
constexpr DirectorySums & Sums() const
lang::SidiListHelper< InfoBox > custom
A list of boxed custom data objects.
Box GetCustomData(int idx)
void SetTargetCrossingFS() noexcept
constexpr uinteger Size() const noexcept
ExtendedEntryInfo * extendedInfo
Extended information, depending on the entry type.
constexpr ExtendedEntryInfo * GetExtendedInfo() const
DateTime mTime
The last write time. (Always available.)
void SetQuality(Qualities v) noexcept
constexpr bool IsCrossingFS() const noexcept
void SetPerms(Permissions v) noexcept
void SetType(Types v) noexcept
constexpr Qualities Quality() const noexcept
constexpr bool IsDirectory() const noexcept
constexpr bool TargetIsCrossingFS() const noexcept
void SetLinkTarget(const String &target, const String &realTarget)
CString & GetLinkTarget() const noexcept
constexpr uint32_t Owner() const noexcept
void SetSize(uinteger v) noexcept
@ MASK
All valid permission bits. Equivalent to all | set_uid | set_gid | sticky_bit.
@ GROUP_READ
< S_IRWXU File owner has read, write, and execute/search permissions Equivalent to owner_read | owner...
@ OTHERS_ALL
S_IRWXO Other users have read, write, and execute/search permissions Equivalent to others_read | othe...
@ GROUP_EXEC
< S_IWGRP The file's user group has write permission
@ OTHERS_EXEC
S_IXOTH Other users have execute/search permission.
@ GROUP_WRITE
< S_IRGRP The file's user group has read permission
@ ALL
All users have read, write, and execute/search permissions Equivalent to owner_all | group_all | othe...
@ UNKNOWN
Unknown permissions (e.g. when not read or filesystem does not support permissions)
@ OWNER_ALL
< S_IXUSR File owner has execute/search permission
@ STICKY_BIT
S_ISVTX Implementation-defined meaning, but POSIX XSI specifies that when set on a directory,...
@ SET_UID
S_ISUID Set user ID to file owner user ID on execution.
@ OWNER_EXEC
< S_IWUSR File owner has write permission
@ SET_GID
S_ISGID Set group ID to file's user group ID on execution.
@ NONE
no permission bits are set
@ OWNER_WRITE
< S_IRUSR File owner has read permission
@ OTHERS_READ
< S_IRWXG The file's user group has read, write, and execute/search permissions Equivalent to group_r...
@ OTHERS_WRITE
S_IWOTH Other users have write permission.
@ GROUP_ALL
< S_IXGRP The file's user group has execute/search permission
constexpr Types Type() const noexcept
void SetGroup(uint32_t v) noexcept
uinteger size
The file size. In case of a directory, this is 0.
constexpr bool IsArtificialFS() const noexcept
constexpr DateTime MTime() const noexcept
void SetArtificialFS() noexcept
AString & WriteTypeAndAccess(AString &target) const
void AddCustomData(MonoAllocator *monoAllocator, Box data)
void SetCrossingFS() noexcept
void SetATime(DateTime v) noexcept
@ RECURSIVE
Follow symlink target strings.
@ STATS
Only stats (size, time, owner, etc.) read.
@ NO_ACCESS_DIR
Scanner failure due to limited access rights.
@ MAX_DEPTH_REACHED
Scanner stopped, because maximum depth was reached.
@ NOT_CROSSING_FS
A directory that represented a mounted filesystem was not followed due to field.
@ RESOLVED
Read symlink target strings.
@ NO_ACCESS_SL
Scanner failure due to limited access rights.
@ UNKNOWN_ERROR
Unknown scanner failure.
@ BROKEN_LINK
A symbolic link targets a non-existent file or directory.
@ NO_ACCESS_SL_TARGET
Scanner failure due to limited access rights.
@ NOT_FOLLOWED
A symbolic link that targets a directory, but scan parameters specify not to follow.
@ NO_ACCESS
Scanner failure due to limited access rights.
@ NOT_EXISTENT
Set if a given start path does not exist.
ALIB_FORCE_INLINE T * Emplace(TArgs &&... args)
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
#define ALIB_WARNINGS_RESTORE
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
#define ALIB_ENUMS_MAKE_ITERABLE(TEnum, StopElement)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_RESOURCED_IN_MODULE(T, Camp, ResName)
lang::uinteger uinteger
Type alias in namespace alib.
characters::character character
Type alias in namespace alib.
boxing::Box Box
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
uint32_t QtyErrsAccess
Number of access errors in the folder and sub-folders.
uint32_t QtyStopsOnCircularLinks
Number of recursion aborts due to detected circular links reach of maximum recursion depth.
constexpr bool IsDirType(Types type) const noexcept
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE uinteger Size
The cumulated sizes of all files and directories.
constexpr DirectorySums & Add(const FInfo &finfo) noexcept
uint32_t Count() const noexcept
constexpr DirectorySums() noexcept=default
uint32_t Count(Types type) const noexcept
uint32_t CountNonDirectories() const noexcept
uint32_t TypeCounters[int(Types::MARKER_TYPES_END)]
Per-type counters.
DirectorySums & operator-=(const DirectorySums &rhs)
uint32_t QtyStopsOnMaxDepth
Number of recursion aborts due to reach of maximum recursion depth.
uint32_t QtyErrsBrokenLink
Number of broken symbolic links in the directory and its sub-folders.
uint32_t CountDirectories() const noexcept
DirectorySums Sums
The recursive sums evaluated during scan.
DirectorySums Sums
The recursive sums evaluated during scan.
static constexpr integer InternalBufSize
The defined size of the internal buffer.
character internalBuf[InternalBufSize]
CString RealTarget
The resolved real target path.
CString Target
The target path. This is a zero-terminated CString.
InfoBox(const Box &pData)
SidiNodeBase() noexcept=default