[ox/fs] Add FileAddress support to FileSystem

This commit is contained in:
2019-10-12 11:56:49 -05:00
parent ce7c416fb7
commit 54ac86fce7
6 changed files with 142 additions and 9 deletions

View File

@@ -10,8 +10,23 @@
namespace ox {
FileLocation::~FileLocation() {
if (m_type == Path) {
FileAddress::FileAddress(uint64_t inode) {
m_data.inode = inode;
m_type = FileAddressType::Inode;
}
FileAddress::FileAddress(char *path) {
m_data.path = path;
m_type = FileAddressType::Path;
}
FileAddress::FileAddress(const char *path) {
m_data.constPath = path;
m_type = FileAddressType::ConstPath;
}
FileAddress::~FileAddress() {
if (m_type == FileAddressType::Path) {
delete m_data.path;
m_data.path = nullptr;
}