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

Description:

The entry type which is embedded in each tree node. Extends class FileStatus of ALib System mainly by DirectorySums, some extended entry information and a possible custom value.

Definition at line 16 of file ftvalue.hpp.

#include <ftvalue.hpp>

Inheritance diagram for alib::filetree::FTValue:
[legend]
Collaboration diagram for alib::filetree::FTValue:
[legend]

Inner Type Index:

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 Method Index:

constexpr ExtendedEntryInfoGetExtendedInfo () const
CPathStringGetLinkTarget () const noexcept
CPathStringGetRealLinkTarget () const noexcept
constexpr void SetExtendedInfo (ExtendedEntryInfo *extInfo)
void SetLinkTarget (FTree &tree, const PathString &target, const PathString &realTarget)
constexpr void SetSums (const DirectorySums &sums) const
constexpr DirectorySumsSums () const
Public Method Index: inherited from alib::system::FileStatus
 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:

void * custom = nullptr
 Pool-allocated custom data.
const std::type_info * dbgCustomType = nullptr
 The custom type attached. Used for asserting misuse in debug-compilations.
ExtendedEntryInfoextendedInfo = nullptr
 Extended information, depending on the entry type.
Protected Field Index: inherited from alib::system::FileStatus
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

Additional Inherited Members

Public Type Index: inherited from alib::system::FileStatus
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: inherited from alib::system::FileStatus
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.

Field Details:

◆ custom

void* alib::filetree::FTValue::custom = nullptr
protected

Pool-allocated custom data.

Definition at line 154 of file ftvalue.hpp.

◆ dbgCustomType

const std::type_info* alib::filetree::FTValue::dbgCustomType = nullptr
protected

The custom type attached. Used for asserting misuse in debug-compilations.

Definition at line 158 of file ftvalue.hpp.

◆ extendedInfo

ExtendedEntryInfo* alib::filetree::FTValue::extendedInfo = nullptr
protected

Extended information, depending on the entry type.

Definition at line 151 of file ftvalue.hpp.

Method Details:

◆ GetExtendedInfo()

ExtendedEntryInfo * alib::filetree::FTValue::GetExtendedInfo ( ) const
inlinenodiscardconstexpr

Retrieves the extended info object of this entry.

Returns
The extended info object of this entry. If not available nullptr is returned.

Definition at line 165 of file ftvalue.hpp.

◆ GetLinkTarget()

CPathString & alib::filetree::FTValue::GetLinkTarget ( ) const
inlinenodiscardnoexcept

Retrieves the non-translated target of a symbolic link. In debug compilations, the method asserts that Type returns either SYMBOLIC_LINK or SYMBOLIC_LINK_DIR.

Returns
A reference to a copy of the zero-terminated string stored in the symbolic link file.

Definition at line 214 of file ftvalue.hpp.

Here is the call graph for this function:

◆ GetRealLinkTarget()

CPathString & alib::filetree::FTValue::GetRealLinkTarget ( ) const
inlinenodiscardnoexcept

Retrieves the resolved target of a symbolic link. In debug compilations, the method asserts that Type returns either SYMBOLIC_LINK or SYMBOLIC_LINK_DIR.

Returns
A reference to a zero-terminated string giving the translated real path that a symbolic link points to.

Definition at line 226 of file ftvalue.hpp.

Here is the call graph for this function:

◆ SetExtendedInfo()

void alib::filetree::FTValue::SetExtendedInfo ( ExtendedEntryInfo * extInfo)
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 PoolAllocator Pool. The object will be freed with the deletion of the corresponding string tree node (respectively FTFile instance).

Parameters
extInfoA pointer to the information object to use.

Definition at line 173 of file ftvalue.hpp.

◆ SetLinkTarget()

void alib::filetree::FTValue::SetLinkTarget ( FTree & tree,
const PathString & target,
const PathString & realTarget )

Stores the link targets in the extended information object created for symbolic links.

Parameters
treeThe tree that this object belongs to.
targetThe target as stored in the symlink
realTargetThe translated, 'real' target path (if not broken).

Definition at line 5 of file ftvalue.cpp.

Here is the call graph for this function:

◆ SetSums()

void alib::filetree::FTValue::SetSums ( const DirectorySums & sums) const
inlineconstexpr

Sets the sums of the extended info object of this entry.

Parameters
sumsThe sums to set.

Definition at line 191 of file ftvalue.hpp.

Here is the call graph for this function:

◆ Sums()

DirectorySums & alib::filetree::FTValue::Sums ( ) const
inlinenodiscardconstexpr

Retrieves the directory sums of this directory or symbolic link to directory.

Returns
A reference to the sums.

Definition at line 177 of file ftvalue.hpp.

Here is the call graph for this function:

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