From 6bd5bfd5007fede16f4a3a10cfbf3cef674f1962 Mon Sep 17 00:00:00 2001 From: georgemoralis Date: Fri, 20 Oct 2023 08:38:54 +0300 Subject: [PATCH] mount points draft --- src/Emulator/Host/fs.cpp | 6 +++++- src/Emulator/Host/fs.h | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/Emulator/Host/fs.cpp b/src/Emulator/Host/fs.cpp index ac25b05b..554abca4 100644 --- a/src/Emulator/Host/fs.cpp +++ b/src/Emulator/Host/fs.cpp @@ -1,3 +1,7 @@ #include "fs.h" -namespace Emulator::Host::Fs {} \ No newline at end of file +namespace Emulator::Host::Fs { +void MntPoints::mount(const std::string& host_folder, const std::string& quest_folder) {} +void MntPoints::unMount(const std::string& path) {} +void MntPoints::unMountAll() {} +} // namespace Emulator::Host::Fs \ No newline at end of file diff --git a/src/Emulator/Host/fs.h b/src/Emulator/Host/fs.h index b188f33a..e35266da 100644 --- a/src/Emulator/Host/fs.h +++ b/src/Emulator/Host/fs.h @@ -1,15 +1,35 @@ #pragma once +#include + #include #include #include #include #include #include -#include #include "Lib/Threads.h" namespace Emulator::Host::Fs { + +class MntPoints { + public: + struct MntPair { + std::string host_path; + std::string guest_path; // e.g /app0/ + }; + + MntPoints() {} + virtual ~MntPoints() {} + void mount(const std::string& host_folder, const std::string& quest_folder); + void unMount(const std::string& path); + void unMountAll(); + + private: + std::vector m_mnt_pairs; + Lib::Mutex m_mutex; + +}; struct File { bool valid = false; // Το descriptor ειναι οντως ανοιχτο; FILE* file; // File handle του αρχειο @@ -82,4 +102,4 @@ class HandleTable { } } }; -} \ No newline at end of file +} // namespace Emulator::Host::Fs \ No newline at end of file