[Yellowstone] Use the file api to load the init file.

This commit is contained in:
Drew Galbraith 2023-11-22 16:58:13 -08:00
parent 86ce0a68a3
commit 8ceab2ad23
6 changed files with 23 additions and 27 deletions

View file

@ -7,10 +7,15 @@
namespace mmth {
// Intended for use in yellowstone since it already has the VFS cap.
void SetVfsCap(z_cap_t vfs_cap);
class File {
public:
static File Open(glcr::StringView path);
uint64_t size() { return size_; }
glcr::StringView as_str();
void* raw_ptr();
@ -18,8 +23,10 @@ class File {
private:
OwnedMemoryRegion file_data_;
uint64_t size_;
File(OwnedMemoryRegion&& file) : file_data_(glcr::Move(file)) {}
File(OwnedMemoryRegion&& file, uint64_t size)
: file_data_(glcr::Move(file)), size_(size) {}
};
} // namespace mmth