| 1 | package SPVM::Sys::IO::Dirent; | ||
| 2 | |||
| 3 | 1; | ||
| 4 | |||
| 5 | =head1 Name | ||
| 6 | |||
| 7 | SPVM::Sys::IO::Dirent - struct dirent in the C language | ||
| 8 | |||
| 9 | =head1 Description | ||
| 10 | |||
| 11 | Sys::IO::Dirent class in L<SPVM> represents L<struct dirent|https://linux.die.net/man/3/readdir> in the C language. | ||
| 12 | |||
| 13 | =head1 Usage | ||
| 14 | |||
| 15 | use Sys; | ||
| 16 | use Sys::IO::DirStream; | ||
| 17 | |||
| 18 | my $dh_ref = [(Sys::IO::DirStream)undef]; | ||
| 19 | |||
| 20 | Sys->opendir($dh_ref, $test_dir); | ||
| 21 | |||
| 22 | my $dh = $dh_ref->[0]; | ||
| 23 | |||
| 24 | my $dirent = Sys->readdir($dh); | ||
| 25 | |||
| 26 | my $d_name = $dirent->d_name; | ||
| 27 | |||
| 28 | =head1 Details | ||
| 29 | |||
| 30 | This class is a pointer class. The pointer the instance has is set to a C<struct dirent> object. | ||
| 31 | |||
| 32 | =head1 Class Methods | ||
| 33 | |||
| 34 | =head2 d_ino | ||
| 35 | |||
| 36 | C<method d_ino : int ();> | ||
| 37 | |||
| 38 | Returns C<d_ino>. | ||
| 39 | |||
| 40 | =head2 d_reclen | ||
| 41 | |||
| 42 | C<method d_reclen : int ();> | ||
| 43 | |||
| 44 | Returns C<d_reclen>. | ||
| 45 | |||
| 46 | =head2 d_name | ||
| 47 | |||
| 48 | C<method d_name : string ();> | ||
| 49 | |||
| 50 | Gets and copies C<d_name> and returns it. | ||
| 51 | |||
| 52 | =head2 d_off | ||
| 53 | |||
| 54 | C<method d_off : long;> | ||
| 55 | |||
| 56 | Returns C<d_off>. | ||
| 57 | |||
| 58 | =head2 d_type | ||
| 59 | |||
| 60 | C<method d_type : int ();> | ||
| 61 | |||
| 62 | Returns C<d_type>. | ||
| 63 | |||
| 64 | =head1 See Also | ||
| 65 | |||
| 66 | =over 2 | ||
| 67 | |||
| 68 | =item * L<readdir|SPVM::Sys/"readdir"> in Sys. | ||
| 69 | |||
| 70 | =item * L<readdir|SPVM::Sys::IO/"readdir"> in Sys::IO. | ||
| 71 | |||
| 72 | =item * L<opendir|SPVM::Sys/"opendir"> in Sys. | ||
| 73 | |||
| 74 | =item * L<opendir|SPVM::Sys::IO/"opendir"> in Sys::IO. | ||
| 75 | |||
| 76 | =item * L<Sys|SPVM::Sys> | ||
| 77 | |||
| 78 | =back | ||
| 79 | |||
| 80 | =head1 Copyright & License | ||
| 81 | |||
| 82 | Copyright (c) 2023 Yuki Kimoto | ||
| 83 | |||
| 84 | MIT License | ||
| 85 |