-
Notifications
You must be signed in to change notification settings - Fork 300
/
Copy pathEntryAttributeFlags.h
45 lines (39 loc) · 1.59 KB
/
EntryAttributeFlags.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include "eden/common/utils/OptionSet.h"
#include "eden/fs/service/gen-cpp2/eden_types.h"
namespace facebook::eden {
struct EntryAttributeFlags
: OptionSet<EntryAttributeFlags, std::underlying_type_t<FileAttributes>> {
constexpr static EntryAttributeFlags raw(FileAttributes raw) {
return OptionSet<
EntryAttributeFlags,
std::underlying_type_t<FileAttributes>>::raw(folly::to_underlying(raw));
}
constexpr static EntryAttributeFlags raw(
std::underlying_type_t<FileAttributes> raw) {
return OptionSet<
EntryAttributeFlags,
std::underlying_type_t<FileAttributes>>::raw(raw);
}
};
inline constexpr auto ENTRY_ATTRIBUTE_SOURCE_CONTROL_TYPE =
EntryAttributeFlags::raw(FileAttributes::SOURCE_CONTROL_TYPE);
inline constexpr auto ENTRY_ATTRIBUTE_SIZE =
EntryAttributeFlags::raw(FileAttributes::FILE_SIZE);
inline constexpr auto ENTRY_ATTRIBUTE_SHA1 =
EntryAttributeFlags::raw(FileAttributes::SHA1_HASH);
inline constexpr auto ENTRY_ATTRIBUTE_BLAKE3 =
EntryAttributeFlags::raw(FileAttributes::BLAKE3_HASH);
inline constexpr auto ENTRY_ATTRIBUTE_OBJECT_ID =
EntryAttributeFlags::raw(FileAttributes::OBJECT_ID);
inline constexpr auto ENTRY_ATTRIBUTE_DIGEST_SIZE =
EntryAttributeFlags::raw(FileAttributes::DIGEST_SIZE);
inline constexpr auto ENTRY_ATTRIBUTE_DIGEST_HASH =
EntryAttributeFlags::raw(FileAttributes::DIGEST_HASH);
} // namespace facebook::eden