1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00
serenity/Userland/Libraries/LibCore/DirectoryEntry.h

34 lines
649 B
C++

/*
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/DeprecatedString.h>
#include <dirent.h>
namespace Core {
struct DirectoryEntry {
enum class Type {
BlockDevice,
CharacterDevice,
Directory,
File,
NamedPipe,
Socket,
SymbolicLink,
Unknown,
Whiteout,
};
Type type;
// FIXME: Once we have a special Path string class, use that.
DeprecatedString name;
static DirectoryEntry from_dirent(dirent const&);
static DirectoryEntry from_stat(DIR*, dirent const&);
};
}