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_attributes.h
Go to the documentation of this file.
1 #pragma once
5 #include "../ustring.h"
6 
8 namespace xtd {
10  namespace io {
20  enum class file_attributes {
22  read_only = 0x0001,
24  hidden = 0x0002,
26  system = 0x0004,
28  directory = 0x0010,
30  archive = 0x0020,
32  device = 0x0040,
34  normal = 0x0080,
36  temporary = 0x0100,
38  sparse_file = 0x0200,
40  reparse_point = 0x0400,
42  compressed = 0x0800,
44  offline = 0x1000,
46  not_content_indexed = 0x2000,
48  encrypted = 0x4000
49  };
50 
52  inline file_attributes& operator^=(file_attributes& lhs, file_attributes rhs) {lhs = static_cast<file_attributes>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
53  inline file_attributes& operator&=(file_attributes& lhs, file_attributes rhs) {lhs = static_cast<file_attributes>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
54  inline file_attributes& operator|=(file_attributes& lhs, file_attributes rhs) {lhs = static_cast<file_attributes>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
55  inline file_attributes& operator+=(file_attributes& lhs, file_attributes rhs) {lhs = static_cast<file_attributes>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
56  inline file_attributes& operator-=(file_attributes& lhs, file_attributes rhs) {lhs = static_cast<file_attributes>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
57  inline file_attributes operator^(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
58  inline file_attributes operator&(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) & static_cast<int>(rhs));}
59  inline file_attributes operator|(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) | static_cast<int>(rhs));}
60  inline file_attributes operator+(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) + static_cast<int>(rhs));}
61  inline file_attributes operator-(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) - static_cast<int>(rhs));}
62  inline file_attributes operator~(file_attributes lhs) {return static_cast<file_attributes>(~static_cast<int>(lhs));}
63  inline std::ostream& operator<<(std::ostream& os, file_attributes value) {return os << to_string(value, {{file_attributes::read_only, "read_only"}, {file_attributes::hidden, "hidden"}, {file_attributes::system, "system"}, {file_attributes::directory, "directory"}, {file_attributes::device, "device"}, {file_attributes::normal, "normal"}, {file_attributes::temporary, "temporary"}, {file_attributes::sparse_file, "sparse_file"}, {file_attributes::reparse_point, "reparse_point"}, {file_attributes::compressed, "compressed"}, {file_attributes::offline, "offline"}, {file_attributes::not_content_indexed, "not_content_indexed"}, {file_attributes::encrypted, "encrypted"}});}
64  inline std::wostream& operator<<(std::wostream& os, file_attributes value) {return os << to_string(value, {{file_attributes::read_only, L"read_only"}, {file_attributes::hidden, L"hidden"}, {file_attributes::system, L"system"}, {file_attributes::directory, L"directory"}, {file_attributes::device, L"device"}, {file_attributes::normal, L"normal"}, {file_attributes::temporary, L"temporary"}, {file_attributes::sparse_file, L"sparse_file"}, {file_attributes::reparse_point, L"reparse_point"}, {file_attributes::compressed, L"compressed"}, {file_attributes::offline, L"offline"}, {file_attributes::not_content_indexed, L"not_content_indexed"}, {file_attributes::encrypted, L"encrypted"}});}
66  }
67 }
The file is a directory.
The file is hidden, and thus is not included in an ordinary directory listing.
The file is temporary. File systems attempt to keep all of the data in memory for quicker access rath...
The file is normal and has no other attributes set. This attribute is valid only if used alone...
file_attributes
Provides attributes for files and directories.
Definition: file_attributes.h:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
The file is a system file. The file is part of the operating system or is used exclusively by the ope...
Exposes static methods for creating, moving, and enumerating through directories and subdirectories...
Definition: directory.h:95
The file or directory is encrypted. For a file, this means that all data in the file is encrypted...
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
The file is compressed.
The file&#39;s archive status. Applications use this attribute to mark files for backup or removal...
The file is offline. The data of the file is not immediately available.
Reserved for future use.
The file will not be indexed by the operating system&#39;s content indexing service.
The file is a sparse file. Sparse files are typically large files whose data are mostly zeros...
The file contains a reparse point, which is a block of user-defined data associated with a file or a ...