DirEntry
Description
Directory entry structure containing type and name.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Dir.h:50:
DirEntryType type;
Str name;
} DirEntry;
///
- In
Dir.h:67:
/// TAGS: System, Directory, Structure, Copy
///
DirEntry *DirEntryInitCopy(DirEntry *dst, const DirEntry *src);
///
- In
Dir.h:83:
/// TAGS: System, Directory, Structure, Cleanup
///
DirEntry *DirEntryDeinitCopy(DirEntry *copy);
///
- In
Dir.h:88:
/// Vector type for directory contents.
///
typedef Vec(DirEntry) DirContents;
// Path-arg dispatch. Library design: `Str *` is the canonical path
- In
Dir.c:41:
}
DirEntry *DirEntryInitCopy(DirEntry *dst, const DirEntry *src) {
if (!dst || !src) {
LOG_FATAL("Invalid arguments");- In
Dir.c:52:
}
DirEntry *DirEntryDeinitCopy(DirEntry *copy) {
if (!copy) {
LOG_FATAL("Invalid arguments");- In
Dir.c:102:
}
DirEntry direntry = {0};
// Determine file type based on attributes
if (findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {- In
Dir.c:264:
int is_dotdot = (name_len == 2) && (nm[0] == '.') && (nm[1] == '.');
if (!is_dot && !is_dotdot) {
DirEntry direntry = {0};
direntry.type = dirent_type_to_misra(de->d_type);
direntry.name = StrInitFromCstr(nm, name_len, alloc);- In
Dir.c:546:
bool trail_sep = (path_len > 0 && path[path_len - 1] == '/');
for (size i = 0; i < VecLen(&dc); ++i) {
DirEntry *e = VecPtrAt(&dc, i);
Zstr entry_nm = StrBegin(&e->name);
if (ZstrCompare(entry_nm, ".") == 0 || ZstrCompare(entry_nm, "..") == 0) {
Last updated on