libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
FILE_SHARE_ACCESS.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <cstdint>
19#include <string>
20
21namespace introvirt {
22namespace windows {
23namespace nt {
24
26 FILE_SHARE_READ = 0x00000001,
27 FILE_SHARE_WRITE = 0x00000002,
28 FILE_SHARE_DELETE = 0x00000004,
29};
30
32 public:
36 uint32_t value() const { return value_; }
37
38 operator uint32_t() const { return value_; }
39
43 void value(uint32_t value) { value_ = value; }
44
49 bool has(FILE_SHARE_ACCESS_FLAG flag) const { return (value_ & flag) != 0u; }
50
54 void clear(FILE_SHARE_ACCESS_FLAG flag) { value_ &= ~(static_cast<uint32_t>(flag)); }
55
59 void set(FILE_SHARE_ACCESS_FLAG flag) { value_ |= flag; }
60
65 std::string to_string(const std::string& separator = " ") const;
66
67 FILE_SHARE_ACCESS() : value_(0) {}
68 FILE_SHARE_ACCESS(uint32_t value) : value_(value) {}
69
70 private:
71 uint32_t value_;
72};
73
74std::string to_string(FILE_SHARE_ACCESS options, const std::string& separator = " ");
75std::ostream& operator<<(std::ostream&, FILE_SHARE_ACCESS options);
76
77} /* namespace nt */
78} /* namespace windows */
79} /* namespace introvirt */
Definition FILE_SHARE_ACCESS.hh:31
void set(FILE_SHARE_ACCESS_FLAG flag)
Definition FILE_SHARE_ACCESS.hh:59
std::string to_string(const std::string &separator=" ") const
uint32_t value() const
Definition FILE_SHARE_ACCESS.hh:36
void value(uint32_t value)
Definition FILE_SHARE_ACCESS.hh:43
void clear(FILE_SHARE_ACCESS_FLAG flag)
Definition FILE_SHARE_ACCESS.hh:54
bool has(FILE_SHARE_ACCESS_FLAG flag) const
Definition FILE_SHARE_ACCESS.hh:49
FILE_SHARE_ACCESS()
Definition FILE_SHARE_ACCESS.hh:67
FILE_SHARE_ACCESS(uint32_t value)
Definition FILE_SHARE_ACCESS.hh:68
FILE_SHARE_ACCESS_FLAG
Definition FILE_SHARE_ACCESS.hh:25
@ FILE_SHARE_READ
Definition FILE_SHARE_ACCESS.hh:26
@ FILE_SHARE_DELETE
Definition FILE_SHARE_ACCESS.hh:28
@ FILE_SHARE_WRITE
Definition FILE_SHARE_ACCESS.hh:27
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20