mount points draft

This commit is contained in:
georgemoralis 2023-10-20 08:38:54 +03:00
parent fda578a625
commit 6bd5bfd500
2 changed files with 27 additions and 3 deletions

View File

@ -1,3 +1,7 @@
#include "fs.h" #include "fs.h"
namespace Emulator::Host::Fs {} 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

View File

@ -1,15 +1,35 @@
#pragma once #pragma once
#include <types.h>
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
#include <filesystem> #include <filesystem>
#include <optional> #include <optional>
#include <vector> #include <vector>
#include <types.h>
#include "Lib/Threads.h" #include "Lib/Threads.h"
namespace Emulator::Host::Fs { 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<MntPair> m_mnt_pairs;
Lib::Mutex m_mutex;
};
struct File { struct File {
bool valid = false; // Ôï descriptor åéíáé ïíôùò áíïé÷ôï; bool valid = false; // Ôï descriptor åéíáé ïíôùò áíïé÷ôï;
FILE* file; // File handle ôïõ áñ÷åéï FILE* file; // File handle ôïõ áñ÷åéï
@ -82,4 +102,4 @@ class HandleTable {
} }
} }
}; };
} } // namespace Emulator::Host::Fs