[ox] Fix Xcode build errors
This commit is contained in:
19
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
19
deps/ox/src/ox/fs/filesystem/directory.hpp
vendored
@ -72,7 +72,7 @@ struct OX_PACKED DirectoryEntry {
|
||||
return fullSize() - sizeof(*this);
|
||||
}
|
||||
|
||||
void setSize(InodeId_t) {
|
||||
void setSize(std::size_t) {
|
||||
// ignore set value
|
||||
}
|
||||
|
||||
@ -94,9 +94,9 @@ class Directory {
|
||||
FileStore m_fs;
|
||||
|
||||
public:
|
||||
Directory() = default;
|
||||
Directory() noexcept = default;
|
||||
|
||||
Directory(FileStore fs, InodeId_t inode);
|
||||
Directory(FileStore fs, uint64_t inode) noexcept;
|
||||
|
||||
/**
|
||||
* Initializes Directory.
|
||||
@ -108,24 +108,26 @@ class Directory {
|
||||
/**
|
||||
* @param parents indicates the operation should create non-existent directories in the path, like mkdir -p
|
||||
*/
|
||||
Error write(PathIterator path, InodeId_t inode, FileName *nameBuff = nullptr) noexcept;
|
||||
Error write(PathIterator path, uint64_t inode64, FileName *nameBuff = nullptr) noexcept;
|
||||
|
||||
Error remove(PathIterator path, FileName *nameBuff = nullptr) noexcept;
|
||||
|
||||
template<typename F>
|
||||
Error ls(F cb) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Result<typename FileStore::InodeId_t> findEntry(const FileName &name) const noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
Result<typename FileStore::InodeId_t> find(PathIterator name, FileName *nameBuff = nullptr) const noexcept;
|
||||
|
||||
};
|
||||
|
||||
template<typename FileStore, typename InodeId_t>
|
||||
Directory<FileStore, InodeId_t>::Directory(FileStore fs, InodeId_t inodeId) {
|
||||
Directory<FileStore, InodeId_t>::Directory(FileStore fs, uint64_t inodeId) noexcept {
|
||||
m_fs = fs;
|
||||
m_inodeId = inodeId;
|
||||
auto buff = m_fs.read(inodeId).template to<Buffer>();
|
||||
m_inodeId = static_cast<InodeId_t>(inodeId);
|
||||
auto buff = m_fs.read(static_cast<InodeId_t>(inodeId)).template to<Buffer>();
|
||||
if (buff.valid()) {
|
||||
m_size = buff.size();
|
||||
}
|
||||
@ -192,7 +194,8 @@ Error Directory<FileStore, InodeId_t>::mkdir(PathIterator path, bool parents, Fi
|
||||
}
|
||||
|
||||
template<typename FileStore, typename InodeId_t>
|
||||
Error Directory<FileStore, InodeId_t>::write(PathIterator path, InodeId_t inode, FileName *nameBuff) noexcept {
|
||||
Error Directory<FileStore, InodeId_t>::write(PathIterator path, uint64_t inode64, FileName *nameBuff) noexcept {
|
||||
const auto inode = static_cast<InodeId_t>(inode64);
|
||||
// reuse nameBuff if it has already been allocated, as it is a rather large variable
|
||||
if (nameBuff == nullptr) {
|
||||
nameBuff = new (ox_alloca(sizeof(FileName))) FileName;
|
||||
|
Reference in New Issue
Block a user