diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:17:47 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-29 18:18:59 +0100 |
| commit | 65254486efff0fd1bb78a48ff90b7713a5ce539f (patch) | |
| tree | 20ce02c12a74ba9e6cd382bf9c1f09a0c611cb4d /Private/Source/DriveManager.cxx | |
| parent | f03986937db0b927da4b10554801e18e4dc7c43f (diff) | |
Kernel: Update TODO.
Src: Refactorings according to clang-format.
Meta: Update specification.
Public: Remove useless UIKit.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/Source/DriveManager.cxx')
| -rw-r--r-- | Private/Source/DriveManager.cxx | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/Private/Source/DriveManager.cxx b/Private/Source/DriveManager.cxx index be35e275..ee279ed1 100644 --- a/Private/Source/DriveManager.cxx +++ b/Private/Source/DriveManager.cxx @@ -10,53 +10,43 @@ #include <KernelKit/DebugOutput.hpp> #include <KernelKit/DriveManager.hpp> -namespace hCore -{ -DriveSelector::DriveSelector() : fDrive(nullptr) -{ -} +namespace hCore { +DriveSelector::DriveSelector() : fDrive(nullptr) {} -DriveSelector::~DriveSelector() -{ - if (fDrive) - { - this->Unmount(); - } +DriveSelector::~DriveSelector() { + if (fDrive) { + this->Unmount(); + } } -DriveTraits &DriveSelector::GetMounted() -{ - MUST_PASS(fDrive != nullptr); - return *fDrive; +DriveTraits &DriveSelector::GetMounted() { + MUST_PASS(fDrive != nullptr); + return *fDrive; } -bool DriveSelector::Mount(DriveTraits *drive) -{ - if (drive && drive->fReady() && fDrive == nullptr) - { - fDrive = drive; - fDrive->fMount(); +bool DriveSelector::Mount(DriveTraits *drive) { + if (drive && drive->fReady() && fDrive == nullptr) { + fDrive = drive; + fDrive->fMount(); - kcout << "[Mount] drive: " << fDrive->fName << "\n"; + kcout << "[Mount] drive: " << fDrive->fName << "\n"; - return true; - } + return true; + } - return false; + return false; } -DriveTraits *DriveSelector::Unmount() -{ - if (!fDrive) - return nullptr; +DriveTraits *DriveSelector::Unmount() { + if (!fDrive) return nullptr; - auto drivePointer = fDrive; + auto drivePointer = fDrive; - fDrive->fUnmount(); - fDrive = nullptr; + fDrive->fUnmount(); + fDrive = nullptr; - kcout << "[Unmount] drive: " << drivePointer->fName << "\n"; + kcout << "[Unmount] drive: " << drivePointer->fName << "\n"; - return drivePointer; + return drivePointer; } -} // namespace hCore +} // namespace hCore |
