[ox] Add StringView, Writer system, Preloader system

This commit is contained in:
2022-11-30 01:45:11 -06:00
parent 98f35140fe
commit cbb496c59f
64 changed files with 2343 additions and 417 deletions

View File

@@ -28,10 +28,10 @@ FileAddress::FileAddress(uint64_t inode) noexcept {
m_type = FileAddressType::Inode;
}
FileAddress::FileAddress(const ox::String &path) noexcept {
FileAddress::FileAddress(ox::CRStringView path) noexcept {
auto pathSize = path.bytes();
m_data.path = new char[pathSize];
memcpy(m_data.path, path.c_str(), pathSize);
memcpy(m_data.path, path.data(), pathSize);
m_type = FileAddressType::Path;
}
@@ -98,7 +98,7 @@ FileAddress &FileAddress::operator=(FileAddress &&other) noexcept {
return *this;
}
bool FileAddress::operator==(const ox::String &path) const noexcept {
bool FileAddress::operator==(CRStringView path) const noexcept {
auto [p, err] = getPath();
if (err) {
return false;