xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
file_access.h
Go to the documentation of this file.
1 #pragma once
5 #include "../ustring.h"
6 
8 namespace xtd {
10  namespace io {
15  enum class file_access {
17  read = 0b1,
19  write = 0b10,
21  read_write = 0b11,
22  };
23 
25  inline file_access& operator^=(file_access& lhs, file_access rhs) {lhs = static_cast<file_access>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
26  inline file_access& operator&=(file_access& lhs, file_access rhs) {lhs = static_cast<file_access>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
27  inline file_access& operator|=(file_access& lhs, file_access rhs) {lhs = static_cast<file_access>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
28  inline file_access& operator+=(file_access& lhs, file_access rhs) {lhs = static_cast<file_access>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
29  inline file_access& operator-=(file_access& lhs, file_access rhs) {lhs = static_cast<file_access>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
30  inline file_access operator^(file_access lhs, file_access rhs) {return static_cast<file_access>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
31  inline file_access operator&(file_access lhs, file_access rhs) {return static_cast<file_access>(static_cast<int>(lhs) & static_cast<int>(rhs));}
32  inline file_access operator|(file_access lhs, file_access rhs) {return static_cast<file_access>(static_cast<int>(lhs) | static_cast<int>(rhs));}
33  inline file_access operator+(file_access lhs, file_access rhs) {return static_cast<file_access>(static_cast<int>(lhs) + static_cast<int>(rhs));}
34  inline file_access operator-(file_access lhs, file_access rhs) {return static_cast<file_access>(static_cast<int>(lhs) - static_cast<int>(rhs));}
35  inline file_access operator~(file_access lhs) {return static_cast<file_access>(~static_cast<int>(lhs));}
36  inline std::ostream& operator<<(std::ostream& os, file_access value) {return os << to_string(value, {{file_access::read, "read"}, {file_access::write, "write"}, {file_access::read_write, "read_write"}});}
37  inline std::wostream& operator<<(std::wostream& os, file_access value) {return os << to_string(value, {{file_access::read, L"read"}, {file_access::write, L"write"}, {file_access::read_write, L"read_write"}});}
39  }
40 }
file_access
Defines constants for read, write, or read/write access to a file. This enumeration has a flags attri...
Definition: file_access.h:15
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
@ read_write
The file is a read_write file. The file is part of the operating read_write or is used exclusively by...
@ read
Read access to the file. Data can be read from the file. Combine with Write for read/write access.
@ write
Write access to the file. Data can be written to the file. Combine with Read for read/write access.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17