This class builds on ALib type StringTree. The contained elements (tree nodes) are of typeFInfo and represent entries in filesystems. Usually the tree is filled using function ScanFiles.
StringTree Interface
Public base class StringTree provides all interfaces necessary to create and delete entries, iterate and recursively walk the file tree. Please consult its documentation for further information.
- Note
- As documented with function ScanFiles, entities of this module ALib Files exclusively store entries along their "Real Path", hence always resolving symbolic links. A user of this library may deviate from this "data contract".
Class File
The base classes' method StringTree::Root is overloaded by this class and returns an instance of class File instead of an instance of class alib{containers;StringTree::Cursor}. This class can be turned into a cursor using AsCursor and then used to navigate through the tree. Then, the cursor can be cast back (or assigned) to a File instance.
Monotonic Behavior
The class fulfills weak monotonic allocation requirements, which is achieved by recycling not only the nodes (what base type StringTree does by default) but also any extended node information. This is implemented with the StringTree handler-type detail::FTreeNodeHandler on the one hand, and on the other hand, with the implementation of the method AllocateExtendedInfo, which has to be exclusively used to attach information structs on FInfo elements.
Furthermore, class File (the nodes of the tree) provides method AttachCustomData, which likewise uses the internal pool-allocator.
In summary, this allows an indefinite sequence of file-scan and result filtering (deletions) with using more memory than the highest resulting fill state in such sequence requires.
Definition at line 150 of file ftree.inl.
|
ALIB_DLL | FTree (MonoAllocator &allocator) |
|
ALIB_DLL | ~FTree () |
| Destructor.
|
|
void | AllocateExtendedInfo (Cursor &node, const system::PathString &symLinkDest, const system::PathString &symLinkRealPath) |
|
template<typename TCustom> |
void | DeleteAllCustomData () |
|
NumberFormat & | GetNumberFormat () |
|
OwnerAndGroupResolver & | GetOGResolver () |
|
bool | HasListeners () |
|
void | MonitorDistinctFile (lang::ContainerOp insertOrRemove, FTreeListener *listener, FTreeListener::Event event, const File &file) |
|
void | MonitorFilesByName (lang::ContainerOp insertOrRemove, FTreeListener *listener, FTreeListener::Event event, const system::PathString &fileName) |
|
void | MonitorPath (lang::ContainerOp insertOrRemove, FTreeListener *listener, FTreeListener::Event event, const FTree::Cursor &cursor) |
|
void | MonitorPathPrefix (lang::ContainerOp insertOrRemove, FTreeListener *listener, FTreeListener::Event event, const system::PathString &pathPrefix) |
|
void | MonitorPathSubstring (lang::ContainerOp insertOrRemove, FTreeListener *listener, FTreeListener::Event event, const system::PathString &pathSubstring) |
|
ALIB_DLL int | MonitorStop (FTreeListener *listener) |
|
void | Notify (FTreeListener::Event event, File &file, SharedLock *lock, const String &filePath=NULL_STRING) |
|
File | Root () |
|
| StringTree (AllocatorType &allocator, CharacterType pathSeparator) |
|
| StringTree (AllocatorType &allocator, CharacterType pathSeparator) |
|
| StringTree (CharacterType pathSeparator, TSharedRecycler &pRecycler) |
|
| StringTree (CharacterType pathSeparator, TSharedRecycler &pRecycler) |
|
| ~StringTree () |
|
| ~StringTree () |
|
void | Clear () |
|
void | Clear () |
|
void | ConstructRootValue (TArgs &&... args) |
|
void | ConstructRootValue (TArgs &&... args) |
|
void | DbgSetDCSName (const char *name) const |
|
void | DbgSetDCSName (const char *name) const |
|
void | DestructRootValue () |
|
void | DestructRootValue () |
|
AllocatorType & | GetAllocator () noexcept |
|
AllocatorType & | GetAllocator () noexcept |
|
ConstCursor | ImportCursor (ConstCursorHandle handle) |
|
ConstCursor | ImportCursor (ConstCursorHandle handle) |
|
Cursor | ImportCursor (CursorHandle handle) |
|
Cursor | ImportCursor (CursorHandle handle) |
|
bool | IsEmpty () const |
|
bool | IsEmpty () const |
|
auto & | NodeTable () |
|
auto & | NodeTable () |
|
const auto & | NodeTable () const |
|
const auto & | NodeTable () const |
|
integer | RecyclablesCount () const |
|
integer | RecyclablesCount () const |
|
void | ReserveRecyclables (integer qty, lang::ValueReference reference) |
|
void | ReserveRecyclables (integer qty, lang::ValueReference reference) |
|
void | Reset () |
|
void | Reset () |
|
Cursor | Root () |
|
Cursor | Root () |
|
const ConstCursor | Root () const |
|
const ConstCursor | Root () const |
|
constexpr CharacterType | Separator () const noexcept |
|
constexpr CharacterType | Separator () const noexcept |
|
integer | Size () const |
|
integer | Size () const |
|
|
ALIB_DLL void | notifyListeners (FTreeListener::Event event, File &file, SharedLock *lock, const system::PathString &filePath) |
|
ALIB_DLL void | registerListener (FTreeListener *listener, lang::ContainerOp insertOrRemove, FTreeListener::Event event, const File *file, const StringTree::Cursor *subTree, const system::PathString &fileName, const system::PathString &pathPrefix, const system::PathString &pathSubstring) |
|
Cursor | createCursor (baseNode &node) |
|
Cursor | createCursor (baseNode &node) |
|
| StringTreeBase (TAllocator &allocator, CharacterType pathSeparator) |
|
template<typename TSharedRecycler = SharedRecyclerType>
requires ( !std::same_as<TSharedRecycler , void> ) |
| StringTreeBase (TAllocator &allocator, TSharedRecycler &pRecycler, CharacterType pathSeparator) |
|
template<typename TSharedRecycler = SharedRecyclerType>
requires (!std::same_as<TSharedRecycler, void>) |
| StringTreeBase (TSharedRecycler &pRecycler, CharacterType pathSeparator) |
|
bool | checkChildName (const NameType &name) const |
|
TAllocator & | GetAllocator () noexcept |
|