Crates.io | keypropdecode |
lib.rs | keypropdecode |
version | 2.0.3 |
source | src |
created_at | 2023-12-20 09:52:24.67719 |
updated_at | 2024-01-18 11:49:41.997918 |
description | A library for decoding Windows file system elements attributes constants |
homepage | https://crates.io/crates/keypropdecode |
repository | https://github.com/kinire98/keypropdecode |
max_upload_size | |
id | 1075154 |
size | 49,211 |
A library for decoding windows file system element properties.
Since Windows stores these properties as a number and each individual property is stored in a determined bit of that number, decoding it can bloat the code.
This library attemps to solve this.
You can use this crate with different purposes:
u32
, with the From trait, and get back a Props instance with the correspondent properties.PathBuf
or a reference to it, with the TryFrom trait, and you won't have to extract the correspondent properties. You can also provide a valid &str
.u32
correpondent to those properties you set. The library will ensure you don't set invalid statesDisplay
implementation of the struct return a String
identical as the one that prints with GetChild-Item
in PowerShell, which are the most commonly used.For reference with all the file system element properties go to the Microsoft File Attribute Constants Documentation.
The implementation of the library uses enums to make invalid states unrepresentable.
It is strongly recommended that if you don't know what a property does, don't change it.
use keypropdecode::Props;
let mut props = Props::default();
props.change_element_type(ArcDir::Archive(ArchiveProps::default()));
assert_eq!(Props::try_from(r"hidden_file_example.txt").unwrap(), props);