xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
file_attributes.h
Go to the documentation of this file.
1
4#pragma once
5#include "../ustring.h"
6
8namespace xtd {
10 namespace io {
17 enum class file_attributes {
19 read_only = 0x0001,
21 hidden = 0x0002,
23 system = 0x0004,
25 directory = 0x0010,
27 archive = 0x0020,
29 device = 0x0040,
31 normal = 0x0080,
33 temporary = 0x0100,
35 sparse_file = 0x0200,
37 reparse_point = 0x0400,
39 compressed = 0x0800,
41 offline = 0x1000,
43 not_content_indexed = 0x2000,
45 encrypted = 0x4000
46 };
47
49 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;}
50 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;}
51 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;}
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) {return static_cast<file_attributes>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
55 inline file_attributes operator&(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) & static_cast<int>(rhs));}
56 inline file_attributes operator|(file_attributes lhs, file_attributes rhs) {return static_cast<file_attributes>(static_cast<int>(lhs) | static_cast<int>(rhs));}
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) {return static_cast<file_attributes>(~static_cast<int>(lhs));}
60 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"}});}
61 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"}});}
63 }
64}
file_attributes
Provides attributes for files and directories.
Definition file_attributes.h:17
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
@ offline
The file is offline. The data of the file is not immediately available.
@ compressed
The file is compressed.
@ encrypted
The file or directory is encrypted. For a file, this means that all data in the file is encrypted....
@ system
The file is a system file. The file is part of the operating system or is used exclusively by the ope...
@ directory
The file is a directory.
@ hidden
The file is hidden, and thus is not included in an ordinary directory listing.
@ sparse_file
The file is a sparse file. Sparse files are typically large files whose data are mostly zeros.
@ reparse_point
The file contains a reparse point, which is a block of user-defined data associated with a file or a ...
@ archive
The file's archive status. Applications use this attribute to mark files for backup or removal.
@ device
Reserved for future use.
@ not_content_indexed
The file will not be indexed by the operating system's content indexing service.
@ read_only
The file is read-only.
@ temporary
The file is temporary. File systems attempt to keep all of the data in memory for quicker access rath...
@ normal
The file is normal and has no other attributes set. This attribute is valid only if used alone.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17