blob: 3a9672d93c9b2f7dd458261375fb4876c017ffcb [file] [log] [blame]
Matthias Andreas Benkard4e8423d2021-12-19 22:56:09 +01001package eu.mulk.jgvariant.ostree;
2
3import eu.mulk.jgvariant.core.Decoder;
4import java.nio.ByteOrder;
5import java.util.List;
6
7/**
8 * Permission bits and extended attributes for a directory.
9 *
10 * <p>Reference: {@code ostree-core.h#OSTREE_DIRMETA_GVARIANT_STRING}
11 */
12public record DirMeta(int uid, int gid, int mode, List<Xattr> xattrs) {
13
14 private static final Decoder<DirMeta> DECODER =
15 Decoder.ofStructure(
16 DirMeta.class,
17 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
18 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
19 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
20 Decoder.ofArray(Xattr.decoder()));
21
22 public static Decoder<DirMeta> decoder() {
23 return DECODER;
24 }
25}