File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
uefi/src/proto/media/file Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 25
25
- Added ` CStr16::as_bytes `
26
26
- Added ` AsRef<[u8]> ` and ` Borrow<[u8]> ` for ` Cstr8 ` and ` CStr16 ` .
27
27
- Added ` LoadedImageDevicePath ` protocol.
28
+ - Added ` FileAttribute::is_directory(&self) ` and
29
+ ` FileAttribute::is_regular_file(&self) `
28
30
29
31
### Changed
30
32
Original file line number Diff line number Diff line change @@ -229,6 +229,18 @@ impl FileInfo {
229
229
pub fn file_name ( & self ) -> & CStr16 {
230
230
unsafe { CStr16 :: from_ptr ( self . file_name . as_ptr ( ) ) }
231
231
}
232
+
233
+ /// Returns if the file is a directory.
234
+ #[ must_use]
235
+ pub fn is_directory ( & self ) -> bool {
236
+ self . attribute . contains ( FileAttribute :: DIRECTORY )
237
+ }
238
+
239
+ /// Returns if the file is a regular file.
240
+ #[ must_use]
241
+ pub fn is_regular_file ( & self ) -> bool {
242
+ !self . is_directory ( )
243
+ }
232
244
}
233
245
234
246
impl Align for FileInfo {
You can’t perform that action at this time.
0 commit comments