#include <StorageUSB.h>
Public Member Functions | |
| StorageUSB (std::string mountPath, std::vector< STORAGE_TYPE > supportedTypes, bool shouldPrint, bool skipMount=false) | |
| virtual | ~StorageUSB () |
| virtual string | insertCheck () |
| virtual string | mountDevice () |
| virtual bool | ejectDevice () |
| virtual bool | isUnsafeEject () |
| bool | getStorageInfo (uint64_t &freeSpaceInMB, uint64_t &totalCapacityInMB) |
| STORAGE_STATE | getStatus () |
| std::string | getMountPath () |
| struct udev_device * | getChildDevice (struct udev *udev, struct udev_device *parent, const char *subsystem) |
Protected Member Functions | |
| string | findMountDeviceBylsblk (string devicePartitionNode) |
| string | findMountedDevice (string devicePartitionNode) |
| std::string | enumerateDevices (struct udev *udev) |
| std::vector< StorageMinimalInfo > | getPartitions (std::string devpath) |
| bool | mountDeviceNode (string deviceNode) |
| bool | mountUSBDevice (StorageMinimalInfo storageDevice, uint8_t retryLimit=3) |
| bool | unMountUSBDevice () |
| bool | unMountWithPrivilege () |
| bool | unMountWithoutPrivilege () |
| bool | mountWithPrivilege (StorageMinimalInfo storageDevice, uint8_t retryLimit=3) |
| bool | mountWithoutPrivilege (StorageMinimalInfo storageDevice) |
| StorageMinimalInfo | getHighCapacityPartition (std::string deviceNode) |
| bool | isDeviceNodeConnected () |
| void | checkDeviceNode () |
Protected Attributes | |
| bool | m_shouldPrint |
| std::vector< STORAGE_TYPE > | m_supportedTypes |
| std::string | m_mountPoint |
| std::string | m_deviceNode |
| std::string | m_partitionNode |
| bool | m_skipMount |
| STORAGE_STATE | m_state |
| std::string | m_manualPath |
| int8_t | m_retryCount |
Definition at line 23 of file StorageUSB.h.
| apra::StorageUSB::StorageUSB | ( | std::string | mountPath, |
| std::vector< STORAGE_TYPE > | supportedTypes, | ||
| bool | shouldPrint, | ||
| bool | skipMount = false |
||
| ) |
Definition at line 37 of file StorageUSB.cpp.
References m_mountPoint, and m_supportedTypes.
|
virtual |
Definition at line 59 of file StorageUSB.cpp.
|
protected |
Definition at line 646 of file StorageUSB.cpp.
References m_deviceNode, m_retryCount, m_state, and apra::STORAGE_SAFE_EJECT.
|
virtual |
Definition at line 523 of file StorageUSB.cpp.
References m_deviceNode, m_mountPoint, m_partitionNode, m_retryCount, m_state, apra::STORAGE_SAFE_EJECT, and unMountUSBDevice().
|
protected |
Definition at line 98 of file StorageUSB.cpp.
References getChildDevice().
Referenced by insertCheck().
|
protected |
Definition at line 538 of file StorageUSB.cpp.
References apra::Utils::caseInsensitiveSearch(), apra::Utils::exec(), m_shouldPrint, and apra::Utils::trim().
Referenced by isUnsafeEject(), mountDevice(), and mountUSBDevice().
|
protected |
Definition at line 564 of file StorageUSB.cpp.
| struct udev_device * apra::StorageUSB::getChildDevice | ( | struct udev * | udev, |
| struct udev_device * | parent, | ||
| const char * | subsystem | ||
| ) |
Definition at line 78 of file StorageUSB.cpp.
Referenced by enumerateDevices().
|
protected |
Definition at line 244 of file StorageUSB.cpp.
References getPartitions(), apra::StorageMinimalInfo::m_fsType, apra::StorageMinimalInfo::m_partition, m_shouldPrint, and apra::StorageMinimalInfo::m_size.
Referenced by mountDevice(), and mountDeviceNode().
| std::string apra::StorageUSB::getMountPath | ( | ) |
Definition at line 68 of file StorageUSB.cpp.
References m_mountPoint, m_state, and apra::STORAGE_MOUNTED.
|
protected |
Definition at line 279 of file StorageUSB.cpp.
References apra::Utils::caseInsensitiveSearch(), apra::Utils::exec(), m_shouldPrint, and MAX_BUF_LEN.
Referenced by getHighCapacityPartition().
| STORAGE_STATE apra::StorageUSB::getStatus | ( | ) |
Definition at line 63 of file StorageUSB.cpp.
References m_state.
| bool apra::StorageUSB::getStorageInfo | ( | uint64_t & | freeSpaceInMB, |
| uint64_t & | totalCapacityInMB | ||
| ) |
Definition at line 590 of file StorageUSB.cpp.
References m_mountPoint, and m_shouldPrint.
|
virtual |
Definition at line 140 of file StorageUSB.cpp.
References enumerateDevices(), m_deviceNode, m_shouldPrint, m_state, apra::STORAGE_INSERTED, apra::STORAGE_SAFE_EJECT, and apra::STORAGE_UNSAFE_EJECT.
Referenced by mountDevice().
|
protected |
Definition at line 265 of file StorageUSB.cpp.
References m_mountPoint.
|
virtual |
Definition at line 212 of file StorageUSB.cpp.
References findMountDeviceBylsblk(), m_deviceNode, m_partitionNode, m_retryCount, m_state, apra::STORAGE_MOUNTED, and apra::STORAGE_UNSAFE_EJECT.
|
virtual |
Definition at line 161 of file StorageUSB.cpp.
References findMountDeviceBylsblk(), apra::STORAGE_TYPE_STRING::getEnum(), getHighCapacityPartition(), insertCheck(), apra::StorageMinimalInfo::m_fsType, m_mountPoint, apra::StorageMinimalInfo::m_partition, m_partitionNode, m_retryCount, m_shouldPrint, apra::StorageMinimalInfo::m_size, m_skipMount, m_state, m_supportedTypes, mountDeviceNode(), apra::STORAGE_INSERTED_UNMOUNTED, and apra::STORAGE_MOUNTED.
|
protected |
Definition at line 363 of file StorageUSB.cpp.
References getHighCapacityPartition(), m_deviceNode, apra::StorageMinimalInfo::m_partition, m_partitionNode, m_shouldPrint, and mountUSBDevice().
Referenced by mountDevice().
|
protected |
Definition at line 324 of file StorageUSB.cpp.
References findMountDeviceBylsblk(), m_manualPath, m_mountPoint, apra::StorageMinimalInfo::m_partition, m_partitionNode, m_shouldPrint, mountWithoutPrivilege(), mountWithPrivilege(), and unMountUSBDevice().
Referenced by mountDeviceNode().
|
protected |
Definition at line 449 of file StorageUSB.cpp.
References apra::Utils::caseInsensitiveSearch(), apra::Utils::exec(), apra::StorageMinimalInfo::m_partition, and m_shouldPrint.
Referenced by mountUSBDevice().
|
protected |
Definition at line 390 of file StorageUSB.cpp.
References apra::StorageMinimalInfo::m_fsType, m_mountPoint, apra::StorageMinimalInfo::m_partition, m_shouldPrint, mountWithPrivilege(), and unMountUSBDevice().
Referenced by mountUSBDevice(), and mountWithPrivilege().
|
protected |
Definition at line 514 of file StorageUSB.cpp.
References unMountWithoutPrivilege(), and unMountWithPrivilege().
Referenced by ejectDevice(), mountUSBDevice(), and mountWithPrivilege().
|
protected |
Definition at line 497 of file StorageUSB.cpp.
References apra::Utils::caseInsensitiveSearch(), apra::Utils::exec(), m_partitionNode, and m_shouldPrint.
Referenced by unMountUSBDevice().
|
protected |
Definition at line 471 of file StorageUSB.cpp.
References m_mountPoint, and m_shouldPrint.
Referenced by unMountUSBDevice().
|
protected |
Definition at line 59 of file StorageUSB.h.
Referenced by checkDeviceNode(), ejectDevice(), insertCheck(), isUnsafeEject(), and mountDeviceNode().
|
protected |
Definition at line 63 of file StorageUSB.h.
Referenced by mountUSBDevice().
|
protected |
Definition at line 58 of file StorageUSB.h.
Referenced by ejectDevice(), getMountPath(), getStorageInfo(), isDeviceNodeConnected(), mountDevice(), mountUSBDevice(), mountWithPrivilege(), StorageUSB(), and unMountWithPrivilege().
|
protected |
Definition at line 60 of file StorageUSB.h.
Referenced by ejectDevice(), isUnsafeEject(), mountDevice(), mountDeviceNode(), mountUSBDevice(), and unMountWithoutPrivilege().
|
protected |
Definition at line 64 of file StorageUSB.h.
Referenced by checkDeviceNode(), ejectDevice(), isUnsafeEject(), and mountDevice().
|
protected |
Definition at line 56 of file StorageUSB.h.
Referenced by findMountDeviceBylsblk(), getHighCapacityPartition(), getPartitions(), getStorageInfo(), insertCheck(), mountDevice(), mountDeviceNode(), mountUSBDevice(), mountWithoutPrivilege(), mountWithPrivilege(), unMountWithoutPrivilege(), and unMountWithPrivilege().
|
protected |
Definition at line 61 of file StorageUSB.h.
Referenced by mountDevice().
|
protected |
Definition at line 62 of file StorageUSB.h.
Referenced by checkDeviceNode(), ejectDevice(), getMountPath(), getStatus(), insertCheck(), isUnsafeEject(), and mountDevice().
|
protected |
Definition at line 57 of file StorageUSB.h.
Referenced by mountDevice(), and StorageUSB().