[ox] Add StringView, Writer system, Preloader system
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user