#include <disk_reader.hpp>
Public Member Functions | |
| DiskReader () | |
| ~DiskReader () | |
| bool | open_readonly (const std::string &path, std::string &error) |
| void | close () |
| bool | is_open () const |
| bool | is_block_device () const |
| uint64_t | size () const |
| uint32_t | logical_sector_size () const |
| const std::string & | path () const |
| bool | read_at (uint64_t offset, void *buffer, size_t len) |
| std::vector< std::byte > | read_block (uint64_t offset, size_t len) |
Private Attributes | |
| int | fd_ |
| bool | is_block_device_ |
| uint64_t | size_ |
| uint32_t | logical_sector_size_ |
| std::string | path_ |
Definition at line 8 of file disk_reader.hpp.
| DiskReader::DiskReader | ( | ) |
Definition at line 17 of file disk_reader.cpp.
References fd_, is_block_device_, logical_sector_size_, and size_.
| DiskReader::~DiskReader | ( | ) |
Definition at line 23 of file disk_reader.cpp.
References close().
| void DiskReader::close | ( | ) |
Definition at line 27 of file disk_reader.cpp.
References close(), fd_, is_block_device_, logical_sector_size_, path_, and size_.
Referenced by close(), FaultTolerantReader::close(), open_readonly(), and ~DiskReader().
| bool DiskReader::is_block_device | ( | ) | const |
Definition at line 92 of file disk_reader.cpp.
References is_block_device_.
| bool DiskReader::is_open | ( | ) | const |
Definition at line 88 of file disk_reader.cpp.
References fd_.
Referenced by FaultTolerantReader::is_open().
| uint32_t DiskReader::logical_sector_size | ( | ) | const |
Definition at line 100 of file disk_reader.cpp.
References logical_sector_size_.
Referenced by FaultTolerantReader::logical_sector_size(), PartitionParser::parse_gpt(), PartitionParser::parse_mbr(), and DeviceHealthProbe::probe().
| bool DiskReader::open_readonly | ( | const std::string & | path, |
| std::string & | error ) |
Definition at line 38 of file disk_reader.cpp.
References close(), fd_, is_block_device_, logical_sector_size_, path(), path_, size_, and trs().
Referenced by RecoveryExporter::export_results_and_carve(), FaultTolerantReader::open(), DeviceHealthProbe::probe(), and ScannerEngine::run_scan().
| const std::string & DiskReader::path | ( | ) | const |
Definition at line 104 of file disk_reader.cpp.
References path_.
Referenced by open_readonly(), and FaultTolerantReader::path().
| bool DiskReader::read_at | ( | uint64_t | offset, |
| void * | buffer, | ||
| size_t | len ) |
Definition at line 108 of file disk_reader.cpp.
Referenced by NtfsProbe::analyze(), anonymous_namespace{filesystem_probes.cpp}::btrfs_has_magic(), anonymous_namespace{filesystem_probes.cpp}::btrfs_probe(), anonymous_namespace{lost_partition_finder.cpp}::btrfs_size_bytes(), anonymous_namespace{ext4_recovery.cpp}::Ext4RecoveryImpl::build_journal_replay_map(), anonymous_namespace{file_carver.cpp}::carve_one_range(), anonymous_namespace{xfs_recovery.cpp}::collect_dir_entries_block_or_leaf(), anonymous_namespace{file_carver.cpp}::copy_range(), anonymous_namespace{ext4_recovery.cpp}::Ext4RecoveryImpl::export_journal(), anonymous_namespace{recovery_exporter.cpp}::export_range(), anonymous_namespace{filesystem_probes.cpp}::ext4_has_magic(), anonymous_namespace{filesystem_probes.cpp}::ext4_probe(), anonymous_namespace{lost_partition_finder.cpp}::ext4_size_bytes(), LostPartitionFinder::find(), anonymous_namespace{filesystem_probes.cpp}::hfs_probe(), anonymous_namespace{lost_partition_finder.cpp}::hfs_size_bytes(), anonymous_namespace{filesystem_recovery.cpp}::Fat32Recovery::load_bpb(), anonymous_namespace{ext4_recovery.cpp}::Ext4RecoveryImpl::load_superblock(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::load_vbr(), anonymous_namespace{lost_partition_finder.cpp}::looks_btrfs(), anonymous_namespace{signature_scanner.cpp}::looks_btrfs(), anonymous_namespace{lost_partition_finder.cpp}::looks_ext4(), anonymous_namespace{signature_scanner.cpp}::looks_ext4(), anonymous_namespace{lost_partition_finder.cpp}::looks_hfs(), anonymous_namespace{lost_partition_finder.cpp}::looks_xfs(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::next_cluster(), anonymous_namespace{filesystem_recovery.cpp}::Fat32Recovery::next_cluster(), anonymous_namespace{partition_parser.cpp}::parse_gpt_table(), PartitionParser::parse_mbr(), anonymous_namespace{encryption_support.cpp}::probe_bitlocker(), anonymous_namespace{encryption_support.cpp}::probe_luks(), FaultTolerantReader::read_at(), read_block(), NtfsRecoveryImpl::read_boot_sector(), anonymous_namespace{encrypted_volume_support.cpp}::read_bytes(), anonymous_namespace{filesystem_recovery.cpp}::ExfatRecovery::read_cluster(), anonymous_namespace{filesystem_recovery.cpp}::Fat32Recovery::read_cluster(), anonymous_namespace{xfs_recovery.cpp}::read_dinode(), anonymous_namespace{hfs_recovery.cpp}::read_exact(), anonymous_namespace{xfs_recovery.cpp}::read_exact(), anonymous_namespace{xfs_recovery.cpp}::read_extents_data(), hfs::read_fork_block_inline(), hfs::read_fork_inline(), anonymous_namespace{ext4_recovery.cpp}::Ext4RecoveryImpl::read_fs_block(), NtfsRecoveryImpl::read_indx_block(), BtrfsRecoveryImpl::read_logical(), NtfsRecoveryImpl::read_mft_record_from_mirror(), hfs::anonymous_namespace{hfs_fork_io.cpp}::read_one_extent(), NtfsRecoveryImpl::read_raw_record(), FaultTolerantReader::read_rescue_recursive(), NtfsRecoveryImpl::read_runs_to_buffer(), anonymous_namespace{filesystem_probes.cpp}::read_sector(), BtrfsRecoveryImpl::reconstruct_raid56_read(), BtrfsRecoveryImpl::recover(), XfsRecovery::recover(), carving::run_carving(), SignatureScanner::scan(), anonymous_namespace{device_health_probe.cpp}::take_sample(), xfs::anonymous_namespace{xfs_btree.cpp}::walk_bmbt_block(), xfs::anonymous_namespace{xfs_btree.cpp}::walk_ibt_block(), anonymous_namespace{encryption_support.cpp}::write_bytes(), anonymous_namespace{filesystem_recovery.cpp}::write_data_to_file(), anonymous_namespace{xfs_recovery.cpp}::write_extents_to_path(), anonymous_namespace{filesystem_probes.cpp}::xfs_probe(), and anonymous_namespace{lost_partition_finder.cpp}::xfs_size_bytes().
| std::vector< std::byte > DiskReader::read_block | ( | uint64_t | offset, |
| size_t | len ) |
Definition at line 128 of file disk_reader.cpp.
References read_at().
| uint64_t DiskReader::size | ( | ) | const |
Definition at line 96 of file disk_reader.cpp.
References size_.
Referenced by anonymous_namespace{encrypted_volume_support.cpp}::bitlocker_probe(), anonymous_namespace{file_carver.cpp}::carve_one_range(), FileCarver::carve_to_directory(), EncryptionSupport::detect_encrypted_volumes(), EncryptionSupport::export_encrypted_metadata(), RecoveryExporter::export_results_and_carve(), LostPartitionFinder::find(), anonymous_namespace{xfs_recovery.cpp}::load_ag_headers(), anonymous_namespace{encrypted_volume_support.cpp}::luks_probe(), PartitionParser::parse_gpt(), DeviceHealthProbe::probe(), HfsRecovery::recover(), XfsRecovery::recover(), carving::run_carving(), ScannerEngine::run_scan(), SignatureScanner::scan(), FaultTolerantReader::size(), anonymous_namespace{hfs_recovery.cpp}::validate_geometry(), and anonymous_namespace{xfs_recovery.cpp}::validate_geometry().
|
private |
Definition at line 26 of file disk_reader.hpp.
Referenced by close(), DiskReader(), is_open(), open_readonly(), and read_at().
|
private |
Definition at line 27 of file disk_reader.hpp.
Referenced by close(), DiskReader(), is_block_device(), and open_readonly().
|
private |
Definition at line 29 of file disk_reader.hpp.
Referenced by close(), DiskReader(), logical_sector_size(), and open_readonly().
|
private |
Definition at line 30 of file disk_reader.hpp.
Referenced by close(), open_readonly(), and path().
|
private |
Definition at line 28 of file disk_reader.hpp.
Referenced by close(), DiskReader(), open_readonly(), read_at(), and size().