~aleteoryx/muditaos

ref: ca75ebe4499b738d5b0e83fa07840ec013522abd muditaos/module-vfs/include/user/purefs/fs/inotify_flags.hpp -rw-r--r-- 1.4 KiB
ca75ebe4 — Lucjan Bryndza [EGD-7587] Change user partition to ext4 fs 4 years ago
                                                                                
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
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once
namespace purefs::fs
{
    //! Event monitor flag
    enum class inotify_flags : unsigned
    {
        attrib        = 0x01, //! Attribute changed
        close_write   = 0x02, //! File closed after write
        close_nowrite = 0x04, //! File closed without write
        del           = 0x08, //! File was deleted
        move_src      = 0x10, //! File moved
        move_dst      = 0x20, //! File moved
        open          = 0x40, //! File was opended
        dmodify       = 0x80, //! Directory entry modified
    };
    inline auto operator|(inotify_flags fl1, inotify_flags fl2)
    {
        return static_cast<inotify_flags>(static_cast<unsigned>(fl1) | static_cast<unsigned>(fl2));
    }
    inline auto operator&(inotify_flags fl1, inotify_flags fl2)
    {
        return static_cast<inotify_flags>(static_cast<unsigned>(fl1) & static_cast<unsigned>(fl2));
    }
    inline auto operator&&(inotify_flags fl1, inotify_flags fl2) -> bool
    {
        return static_cast<bool>(static_cast<unsigned>(fl1) & static_cast<unsigned>(fl2));
    }
    inline auto operator||(inotify_flags fl1, inotify_flags fl2) -> bool
    {
        return static_cast<bool>(static_cast<unsigned>(fl1) | static_cast<unsigned>(fl2));
    }

} // namespace purefs::fs