ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::system::FileStatus Class Reference

Description:

Represents metadata of a filesystem entry.

This type is the lightweight data container to hold file attributes such as:

  • file type and scan state,
  • size, timestamps, ownership, permissions and hard-link count,
  • optional scan flags related to symlink resolution and filesystem boundaries.

Instances are typically populated with the overloaded method Update. The result of retrieval is reflected in the field ScanState and may indicate partial or failed retrieval (for example, non-existing paths or missing access rights).

Relationship To Module ALib FileTree
The module ALib Module ALib FileTree builds on this type by extending this type to the class FTValue with scan- and file-tree-specific payload. With this, users of module ALib FileTree gain additional features when scanning the file system, including symbolic-vs-real path handling, symbolic link resolving, symbolic parent tracking, and formatted file information output.
To keep the code efficient, some of the features that are available only with the class FTValue are already reflected in this class. For example, the enumeration element FileStatus::Types::SYMBOLIC_LINK_DIR is never set with methods Update, but only when scanning file trees. While this can be considered an inconsistent API definition, this approach serves runtime efficiency.
Restrictions On Non-POSIX Systems
Two versions of the implementation of overloaded methods Update exist, which depend on the target system and optionally on the configuration macro ALIB_SYSTEM_FORCE_STD_FILE_STATUS. The non-POSIX version is restricted due to the fact that the std::filesystem API is less feature-richt than what POSIX offers.
See also
Classes FTFile and FTValue.

Definition at line 41 of file filestatus.hpp.

#include <filestatus.hpp>

Inheritance diagram for alib::system::FileStatus:
[legend]
Collaboration diagram for alib::system::FileStatus:
[legend]

Inner Type Index:

struct  Bits
 A bitfield encoding various information. 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  ScanStates : 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  ScanStates3Letters : 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:

 FileStatus ()
 Default constructor.
 FileStatus (Path &path, bool isCanonical=false)
constexpr DateTime ADate () const noexcept
constexpr DateTime BDate () const noexcept
constexpr DateTime CDate () const noexcept
const NString GetGroupName () const
const NString GetOwnerName () const
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 uint64_t PosixDevice () const noexcept
constexpr uint32_t QtyHardLinks () const noexcept
constexpr ScanStates ScanState () const noexcept
void SetADate (DateTime v) noexcept
void SetArtificialFS () noexcept
 Mark the entry as residing on an artificial filesystem.
void SetBDate (DateTime v) noexcept
void SetCDate (DateTime v) noexcept
void SetCrossingFS () noexcept
 Mark the entry as residing on a different filesystem than its parent.
void SetGroup (uint32_t v) noexcept
void SetMDate (DateTime v) noexcept
void SetOwner (uint32_t v) noexcept
void SetPerms (Permissions v) noexcept
void SetPosixDevice (uint64_t deviceCode) noexcept
void SetQtyHardlinks (uint32_t v) noexcept
void SetScanState (ScanStates v) noexcept
void SetSize (uinteger v) noexcept
void SetTargetArtificialFS () noexcept
 Mark the entry as a symlink who's target is residing on an artificial filesystem.
void SetTargetCrossingFS () noexcept
void SetType (Types v) noexcept
constexpr uinteger Size () const noexcept
constexpr bool TargetIsArtificialFS () const noexcept
constexpr bool TargetIsCrossingFS () const noexcept
constexpr Types Type () const noexcept
ScanStates Update (Path &path, bool isCanonical=false)
ScanStates Update (std::filesystem::path &path, bool isCanonical=false)

Protected Field Index:

DateTime aDate
DateTime bDate
Bits bits
 A bitfield encoding various information.
DateTime cDate
uint64_t device
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.
uinteger symParent = 0

Type Definition Details:

◆ TOwnerAndGroupID

Type definition for owner and group ids.

Definition at line 133 of file filestatus.hpp.

Enumeration Details:

◆ Permissions

enum class alib::system::FileStatus::Permissions : 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_READ 

Posix S_IRUSR: File owner has read permission.

OWNER_WRITE 

Posix S_IWUSR: File owner has write permission.

OWNER_EXEC 

Posix S_IXUSR: File owner has execute/search permission.

OWNER_ALL 

Posix S_IRWXU: File owner has read, write, and execute/search permissions Equivalent to owner_read | owner_write | owner_exec.

GROUP_READ 

Posix S_IRGRP: The file's user group has read permission.

GROUP_WRITE 

Posix S_IWGRP: The file's user group has write permission.

GROUP_EXEC 

Posix S_IXGRP: The file's user group has execute/search permission.

GROUP_ALL 

Posix S_IRWXG: The file's user group has read, write, and execute/search permissions Equivalent to group_read | group_write | group_exec.

OTHERS_READ 

Posix S_IROTH: Other users have read permission.

OTHERS_WRITE 

Posix S_IWOTH: Other users have write permission.

OTHERS_EXEC 

Posix S_IXOTH: Other users have execute/search permission.

OTHERS_ALL 

Posix S_IRWXO: Other users have read, write, and execute/search permissions Equivalent to others_read | others_write | others_exec.

SET_UID 

Posix S_ISUID: Set user ID to file owner user ID on execution.

SET_GID 

Posix S_ISGID: Set group ID to file's user group ID on execution.

STICKY_BIT 

Posix 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).

Definition at line 106 of file filestatus.hpp.

◆ ScanStates

enum class alib::system::FileStatus::ScanStates : uint8_t
strong

Per-entry information about how a node was scanned.

Enumerator
NONE 

Node created only from the given start path.

STATS 

Only stats (size, date, owner, etc.) read.

RESOLVED 

Read symlink target strings.

MAX_DEPTH_REACHED 

Scanning 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 the field bool CrossFileSystems being set to false.

NO_AFS 

A directory that represented a mounted filesystem was not followed due to the field bool IncludeArtificialFS being set to false.

RECURSIVE 

Follow symlink target strings.

NO_ACCESS 

Scanner failure due to limited access rights.

NO_ACCESS_SL 

Scanner failure due to limited access rights on a symbolic link.

NO_ACCESS_SL_TARGET 

Scanner failure due to limited access rights on a symbolic link's target.

NO_ACCESS_DIR 

Scanner failure due to limited access rights on a directory.

BROKEN_LINK 

A symbolic link targets a non-existent file or directory.

CIRCULAR_LINK 

Set if recursion stopped at 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.

Definition at line 139 of file filestatus.hpp.

◆ ScanStates3Letters

enum class alib::system::FileStatus::ScanStates3Letters : uint8_t
strong

This is a resourced enumeration that is equivalent to enum class ScanStates but uses a 3-Letter code when serialized.

Enumerator
NONE 

NON: Node created only from given start path 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 the field bool CrossFileSystems being set to false.

NO_AFS 

NAF:A directory that represented a mounted filesystem was not followed due to the field bool IncludeArtificialFS being set to false.

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 

CIL: Set if recursion stopped on a symbolic link which was identified by the operating system as a circular link.

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.

Definition at line 170 of file filestatus.hpp.

◆ TypeNames1Letter

enum class alib::system::FileStatus::TypeNames1Letter : uint8_t
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.

Enumerator
DIRECTORY 

d: Directory/folder.

SYMBOLIC_LINK_DIR 

L: Symbolic link targeting a directory.

REGULAR 

-: Regular file.

SYMBOLIC_LINK 

l: Symbolic link targeting a non-directory file.

BLOCK 

b: A block special file.

CHARACTER 

c: A character special file.

FIFO 

p: A FIFO (also known as pipe) file.

SOCKET 

s: A socket file.

Definition at line 67 of file filestatus.hpp.

◆ TypeNames2Letters

enum class alib::system::FileStatus::TypeNames2Letters : uint8_t
strong

This is a resourced enumeration that is equivalent to enum class Types but uses a 2-Letter code when serialized.

Enumerator
DIRECTORY 

DR: Directory/folder.

SYMBOLIC_LINK_DIR 

LD: Symbolic link targeting a directory.

REGULAR 

RF: Regular file.

SYMBOLIC_LINK 

LF: Symbolic link targeting a non-directory file.

BLOCK 

BL: A block special file.

CHARACTER 

CH: A character special file.

FIFO 

FF: A FIFO (also known as pipe) file.

SOCKET 

SO: A socket file.

Definition at line 80 of file filestatus.hpp.

◆ TypeNames3Letters

enum class alib::system::FileStatus::TypeNames3Letters : uint8_t
strong

This is a resourced enumeration that is equivalent to enum class Types but uses a 3-Letter code when serialized.

Enumerator
DIRECTORY 

DIR: Directory/folder.

SYMBOLIC_LINK_DIR 

SLD: Symbolic link targeting a directory.

REGULAR 

REG: Regular file.

SYMBOLIC_LINK 

SLF: Symbolic link targeting a non-directory file.

BLOCK 

BLK: A block special file.

CHARACTER 

CHR: A character special file.

FIFO 

FFO: A FIFO (also known as pipe) file.

SOCKET 

SCK: A socket file.

Definition at line 93 of file filestatus.hpp.

◆ Types

enum class alib::system::FileStatus::Types : uint8_t
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.

Enumerator
DIRECTORY 

Directory/folder.

SYMBOLIC_LINK_DIR 

Symbolic link targeting a directory. In case scanning does not resolve links, this is never set.

REGULAR 

Regular file.

SYMBOLIC_LINK 

Symbolic link targeting a non-directory file. In case scanning does not resolve links, possibly to a directory.

BLOCK 

A block special file.

CHARACTER 

A character special file.

FIFO 

A FIFO (also known as pipe) file.

SOCKET 

A socket file.

UNKNOWN_OR_ERROR 

Filetype (should never or seldom happen). Maybe filesystem changed during scan or similar strange thing.

MARKER_TYPES_END 

A marker for the last countable type. The rest are unused/errors.

Definition at line 46 of file filestatus.hpp.

Field Details:

◆ aDate

DateTime alib::system::FileStatus::aDate
protected

The date of last read or write access. This is not correctly set on all platforms/filesystems. If not available, it will be set to mDate.

Definition at line 210 of file filestatus.hpp.

◆ bDate

DateTime alib::system::FileStatus::bDate
protected

The date this file was created. This timestamp is correctly set only with certain filesystems under GNU/Linux, e.g., 'EXT4'. If not available, the smallest value of the other three timestamps is used.

Definition at line 203 of file filestatus.hpp.

◆ bits

Bits alib::system::FileStatus::bits
protected

A bitfield encoding various information.

Definition at line 243 of file filestatus.hpp.

◆ cDate

DateTime alib::system::FileStatus::cDate
protected

The date of the last change of the files' meta-information (e.g., owner). This is not correctly set on all platforms/filesystems. If not available, it will be set to mDate.

Definition at line 207 of file filestatus.hpp.

◆ device

uint64_t alib::system::FileStatus::device
protected

The POSIX device ID. Available only if ALIB_SYSTEM_FILE_STATUS_IMPL equals ALIB_SYSTEM_FILE_POSIX_STATUS.

Definition at line 245 of file filestatus.hpp.

◆ group

uint32_t alib::system::FileStatus::group
protected

The group id that owns the file.

Definition at line 217 of file filestatus.hpp.

◆ mDate

DateTime alib::system::FileStatus::mDate
protected

The last date and time the contents of the file was modified. This timestamp is should be correct on all platforms/filesystems.

Definition at line 201 of file filestatus.hpp.

◆ owner

uint32_t alib::system::FileStatus::owner
protected

The user id that owns the file.

Definition at line 216 of file filestatus.hpp.

◆ qtyHardLinks

uint32_t alib::system::FileStatus::qtyHardLinks
protected

The number of hard links to the file.

Definition at line 218 of file filestatus.hpp.

◆ size

uinteger alib::system::FileStatus::size
protected

The file size. In case of a directory, this is 0.

Definition at line 215 of file filestatus.hpp.

◆ symParent

uinteger alib::system::FileStatus::symParent = 0
protected

A cursor handle to the symbolic parent. See manual chapter 2.3 Real-Paths for more information.

Definition at line 213 of file filestatus.hpp.

◆ UnknownID

TOwnerAndGroupID alib::system::FileStatus::UnknownID = (std::numeric_limits<uint32_t>::max)()
staticconstexpr

Constant value for owner and group IDs to denote that the field was not determined.

Definition at line 136 of file filestatus.hpp.

Constructor(s) / Destructor Details:

◆ FileStatus() [1/2]

alib::system::FileStatus::FileStatus ( )
inline

Default constructor.

Definition at line 251 of file filestatus.hpp.

◆ FileStatus() [2/2]

alib::system::FileStatus::FileStatus ( Path & path,
bool isCanonical = false )
inline

Constructor taking a path. Calls ScanStates Update(Path&, bool) .

Parameters
pathThe file path to get the status for.
isCanonicalIf given as true, then the caller guarantees that path does not resemble a symbolic link. Defaults to false, which causes the method to call Path::MakeCanonical on path first.

Definition at line 261 of file filestatus.hpp.

Here is the call graph for this function:

Method Details:

◆ ADate()

DateTime alib::system::FileStatus::ADate ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the timestamp of last access to this file/folder. If unavailable, same as MDate.

Definition at line 312 of file filestatus.hpp.

◆ BDate()

DateTime alib::system::FileStatus::BDate ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the birth date of this file/folder.

Definition at line 308 of file filestatus.hpp.

◆ CDate()

DateTime alib::system::FileStatus::CDate ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the change date of this file/folder. If unavailable, same as MDate.

Definition at line 310 of file filestatus.hpp.

◆ GetGroupName()

const NString alib::system::FileStatus::GetGroupName ( ) const
nodiscard
Returns
Retrieves the name of the group of the file/folder if available. Otherwise, and on the WindowsOS platform, "?" is returned.

Definition at line 17 of file filestatus.cpp.

◆ GetOwnerName()

const NString alib::system::FileStatus::GetOwnerName ( ) const
nodiscard
Returns
Retrieves the name of the owner of the file/folder if available. Otherwise, and on the WindowsOS platform, "?" is returned.

Definition at line 8 of file filestatus.cpp.

◆ Group()

uint32_t alib::system::FileStatus::Group ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the ID of the group of the file/folder if available. Otherwise set to UnknownID.

Definition at line 316 of file filestatus.hpp.

◆ IsArtificialFS()

bool alib::system::FileStatus::IsArtificialFS ( ) const
inlinenodiscardconstexprnoexcept
Returns
Returns true if the entry resides on an artificial filesystem.

Definition at line 294 of file filestatus.hpp.

◆ IsCrossingFS()

bool alib::system::FileStatus::IsCrossingFS ( ) const
inlinenodiscardconstexprnoexcept
Returns
Returns true if the entry resides on a different filesystem than it's parent.

Definition at line 298 of file filestatus.hpp.

◆ IsDirectory()

bool alib::system::FileStatus::IsDirectory ( ) const
inlinenodiscardconstexprnoexcept
Returns
Checks type for being either directory or symbolic link pointing to one.

Definition at line 287 of file filestatus.hpp.

◆ IsSymbolicLink()

bool alib::system::FileStatus::IsSymbolicLink ( ) const
inlinenodiscardconstexprnoexcept
Returns
Checks type for being a symbolic link (to normal file or to a directory).

Definition at line 289 of file filestatus.hpp.

Here is the call graph for this function:

◆ MDate()

DateTime alib::system::FileStatus::MDate ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the last modification date of this file/folder.

Definition at line 306 of file filestatus.hpp.

◆ Owner()

uint32_t alib::system::FileStatus::Owner ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the ID of the owner of the file/folder if available. Otherwise set to UnknownID.

Definition at line 314 of file filestatus.hpp.

◆ Perms()

Permissions alib::system::FileStatus::Perms ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the permissions of the entry.

Definition at line 283 of file filestatus.hpp.

◆ PosixDevice()

uint64_t alib::system::FileStatus::PosixDevice ( ) const
inlinenodiscardconstexprnoexcept
Returns
Returns the POSIX device code.

Definition at line 302 of file filestatus.hpp.

◆ QtyHardLinks()

uint32_t alib::system::FileStatus::QtyHardLinks ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the number of hard links pointing to this file if available. Otherwise set to UnknownID.

Definition at line 318 of file filestatus.hpp.

◆ ScanState()

ScanStates alib::system::FileStatus::ScanState ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the scan sate of the entry.

Definition at line 292 of file filestatus.hpp.

◆ SetADate()

void alib::system::FileStatus::SetADate ( DateTime v)
inlinenoexcept

Sets the time of last access of this file/folder.

Parameters
vThe value to set.

Definition at line 375 of file filestatus.hpp.

◆ SetArtificialFS()

void alib::system::FileStatus::SetArtificialFS ( )
inlinenoexcept

Mark the entry as residing on an artificial filesystem.

Definition at line 341 of file filestatus.hpp.

◆ SetBDate()

void alib::system::FileStatus::SetBDate ( DateTime v)
inlinenoexcept

Sets the birth date of this file/folder.

Parameters
vThe value to set.

Definition at line 367 of file filestatus.hpp.

◆ SetCDate()

void alib::system::FileStatus::SetCDate ( DateTime v)
inlinenoexcept

Sets the change date of this file/folder.

Parameters
vThe value to set.

Definition at line 371 of file filestatus.hpp.

◆ SetCrossingFS()

void alib::system::FileStatus::SetCrossingFS ( )
inlinenoexcept

Mark the entry as residing on a different filesystem than its parent.

Definition at line 347 of file filestatus.hpp.

◆ SetGroup()

void alib::system::FileStatus::SetGroup ( uint32_t v)
inlinenoexcept

Sets the ID of the group of the file/folder.

Parameters
vThe value to set.

Definition at line 383 of file filestatus.hpp.

◆ SetMDate()

void alib::system::FileStatus::SetMDate ( DateTime v)
inlinenoexcept

Sets the last modification date of this file/folder.

Parameters
vThe value to set.

Definition at line 363 of file filestatus.hpp.

◆ SetOwner()

void alib::system::FileStatus::SetOwner ( uint32_t v)
inlinenoexcept

Sets the ID of the owner of the file/folder.

Parameters
vThe value to set.

Definition at line 379 of file filestatus.hpp.

◆ SetPerms()

void alib::system::FileStatus::SetPerms ( Permissions v)
inlinenoexcept

Sets the permissions of the entry.

Parameters
vThe value to set.

Definition at line 330 of file filestatus.hpp.

◆ SetPosixDevice()

void alib::system::FileStatus::SetPosixDevice ( uint64_t deviceCode)
inlinenoexcept

Set the POSIX device code.

Parameters
deviceCodeThe POSIX device code.

Definition at line 351 of file filestatus.hpp.

◆ SetQtyHardlinks()

void alib::system::FileStatus::SetQtyHardlinks ( uint32_t v)
inlinenoexcept

Sets the number of hard links that point to this file.

Parameters
vThe value to set.

Definition at line 387 of file filestatus.hpp.

◆ SetScanState()

void alib::system::FileStatus::SetScanState ( ScanStates v)
inlinenoexcept

Sets the state of scan of the entry.

Parameters
vThe value to set.

Definition at line 338 of file filestatus.hpp.

◆ SetSize()

void alib::system::FileStatus::SetSize ( uinteger v)
inlinenoexcept

Sets the file size.

Parameters
vThe value to set.

Definition at line 359 of file filestatus.hpp.

◆ SetTargetArtificialFS()

void alib::system::FileStatus::SetTargetArtificialFS ( )
inlinenoexcept

Mark the entry as a symlink who's target is residing on an artificial filesystem.

Definition at line 344 of file filestatus.hpp.

◆ SetTargetCrossingFS()

void alib::system::FileStatus::SetTargetCrossingFS ( )
inlinenoexcept

Mark the entry as a symlink who's target is residing in a different filesystem than the symlink.

Definition at line 355 of file filestatus.hpp.

◆ SetType()

void alib::system::FileStatus::SetType ( Types v)
inlinenoexcept

Sets the type of the entry.

Parameters
vThe value to set.

Definition at line 334 of file filestatus.hpp.

◆ Size()

uinteger alib::system::FileStatus::Size ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the file size.

Definition at line 304 of file filestatus.hpp.

◆ TargetIsArtificialFS()

bool alib::system::FileStatus::TargetIsArtificialFS ( ) const
inlinenodiscardconstexprnoexcept
Returns
Returns true if the entry is a symlink and its target resides on an artificial filesystem.

Definition at line 296 of file filestatus.hpp.

◆ TargetIsCrossingFS()

bool alib::system::FileStatus::TargetIsCrossingFS ( ) const
inlinenodiscardconstexprnoexcept
Returns
Returns true if the entry is a symlink and resides on a different filesystem than the link.

Definition at line 300 of file filestatus.hpp.

◆ Type()

Types alib::system::FileStatus::Type ( ) const
inlinenodiscardconstexprnoexcept
Returns
Retrieves the type of the entry

Definition at line 285 of file filestatus.hpp.

◆ Update() [1/2]

FileStatus::ScanStates alib::system::FileStatus::Update ( Path & path,
bool isCanonical = false )

Updates all members according to the given path.

Parameters
pathThe file path to get the status for.
isCanonicalIf given as true, then the caller guarantees that path does not resemble a symbolic link. Defaults to false, which causes the method to call Path::MakeCanonical on path first.
Returns
The result of retrieving the given filePaths' state.

Definition at line 56 of file filestatus.cpp.

Here is the call graph for this function:

◆ Update() [2/2]

FileStatus::ScanStates alib::system::FileStatus::Update ( std::filesystem::path & path,
bool isCanonical = false )

Updates all members according to the given std::filesystem::path.

Parameters
pathThe file path to get the status for.
isCanonicalIf given as true, then the caller guarantees that path does not resemble a symbolic link. Defaults to false, which causes the method to call Path::MakeCanonical on path first.
Returns
The result of retrieving the given filePaths' state.

Definition at line 51 of file filestatus.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: