iceoryx_hoofs  2.0.2
filesystem.hpp
1 // Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // SPDX-License-Identifier: Apache-2.0
16 #ifndef IOX_HOOFS_CXX_FILESYSTEM_HPP
17 #define IOX_HOOFS_CXX_FILESYSTEM_HPP
18 
19 #include <cstdint>
20 
21 namespace iox
22 {
23 namespace cxx
24 {
31 enum class perms : uint64_t
32 {
34  none = 0,
35 
37  owner_read = 0400,
39  owner_write = 0200,
41  owner_exec = 0100,
43  owner_all = 0700,
44 
46  group_read = 040,
48  group_write = 020,
50  group_exec = 010,
52  group_all = 070,
53 
55  others_read = 04,
57  others_write = 02,
59  others_exec = 01,
61  others_all = 07,
62 
64  all = 0777,
65 
68  set_uid = 04000,
71  set_gid = 02000,
74  sticky_bit = 01000,
75 
77  mask = 07777,
78 
80  unknown = 0xFFFF
81 };
82 
87 perms operator|(const perms& lhs, const perms& rhs) noexcept;
88 
93 perms operator&(const perms& lhs, const perms& rhs) noexcept;
94 
99 perms operator^(const perms& lhs, const perms& rhs) noexcept;
100 
104 perms operator~(const perms& value) noexcept;
105 
110 perms operator|=(perms& lhs, const perms& rhs) noexcept;
111 
116 perms operator&=(perms& lhs, const perms& rhs) noexcept;
117 
122 perms operator^=(perms& lhs, const perms& rhs) noexcept;
123 
129 template <typename StreamType>
130 StreamType& operator<<(StreamType& stream, perms value) noexcept;
131 } // namespace cxx
132 } // namespace iox
133 
134 #endif
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:29
std::ostream & operator<<(std::ostream &stream, Error value) noexcept
Convenience stream operator to easily use the Error enum with std::ostream.