ost::DirTree(3)
πΈ NAME πΈ
ost::DirTree β a generic class to walk a hierarchical directory structure. That's it, that's the whole vibe. π
It lives in the Library Functions Manual (section 3), iykyk.
β¨ SYNOPSIS β¨
#include <file.h>
π«Ά Public Member Functions
DirTree(const char *prefix, unsigned maxdepth)β construct a directory tree walk starting at the specified prefix.DirTree(unsigned maxdepth)β construct an un-opened directory tree of a known maximum depth.virtual ~DirTree()β the destructor. she's virtual, she's iconic.void open(const char *prefix)β open a directory tree path.void close(void)β close the directory path.char *getPath(void)β extract the next full pathname from the directory walk.unsigned perform(const char *prefix)β this is used to step through thefiltervirtual for an entire subtree, and it's for cases where a derivedDirTreeclass performs its primary operations throughfilterrather than externally by callinggetPath(). bestie said "I'll do it myself" π€
π Protected Member Functions
virtual bool filter(const char *file, struct stat *ino)β virtual method to filter results.
π Detailed Description
A generic class to walk a hierarchical directory structure. no notes, perfect, ate. π₯
π Author
David Sugar dyfet@ostel.com
Directory tree walking. π
ποΈ Constructor & Destructor Documentation
ost::DirTree::DirTree(const char *prefix, unsigned maxdepth)
Construct a directory tree walk starting at the specified prefix. You also gotta hand over a maximum subdirectory depth. depth check, but for directories. π¦
Parameters
- prefix β prefix to start walk.
- maxdepth β subdirectory depth to examine.
ost::DirTree::DirTree(unsigned maxdepth)
Construct an un-opened directory tree of a known maximum depth. she's not opened yet, she's just... aware of her own limits. main character energy. π
Parameters
- maxdepth β subdirectory subdirectory depth.
okay yes it literally says "subdirectory subdirectory" twice in the original, I'm not gaslighting you π that's just what it says.
virtual ost::DirTree::~DirTree() [virtual]
The destructor. she cleans up. π
π§ Member Function Documentation
void ost::DirTree::close(void)
Close the directory path. bye bestie, love u, see u next walk π
virtual bool ost::DirTree::filter(const char *file, struct stat *ino) [protected], [virtual]
Virtual method to filter results. Important: virtual override methods should call the baseclass method to assure . and .. names are stripped out. don't skip that step, fr fr, or . and .. will be sitting in your results like uninvited guests at the function. π
Returns
trueif current filename is accepted.
Parameters
- file β path to examine
- ino β info of type, date, etc.
char* ost::DirTree::getPath(void)
Extract the next full pathname from the directory walk. When returning directories, a / is appended. The returned string is a buffer of MAX_PATH size. so cute of her to hand you a whole buffer. β¨
Returns
- path of next subdirectory entry or
NULL.
void ost::DirTree::open(const char *prefix)
Open a directory tree path.
Parameters
- prefix β directory path to open.
unsigned ost::DirTree::perform(const char *prefix)
This is used to step through the filter virtual for an entire subtree, and is used for cases where a derived DirTree class performs its primary operations through filter rather than externally by calling getPath(). it's giving "I contain my own chaos" and honestly? respect. π«Ά
Returns
- number of files and directories examined.
Parameters
- prefix β directory path to examine.
π Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
and that's the whole page, bestie!! π this little icon was built by GNU CommonC++ and stamped Sun Dec 27 2020 β now go walk some directories and slay. π¦β¨π
π¦ where this page comes from
- ubuntu jammy: libcommoncpp2-doc 1.8.1-10
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms