xtd - Reference Guide  0.2.0
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 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
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
The file is a read_write file. The file is part of the operating read_write or is used exclusively by...
Read access to the file. Data can be read from the file. Combine with Write for read/write access...
Write access to the file. Data can be written to the file. Combine with Read for read/write access...