[ox] Replace C strings in FS with StringView

This commit is contained in:
2022-12-31 14:18:38 -06:00
parent 5cae7cbd24
commit ca07dc6152
16 changed files with 148 additions and 128 deletions

View File

@@ -43,15 +43,6 @@ FileAddress::FileAddress(char *path) noexcept {
m_type = FileAddressType::Path;
}
FileAddress::FileAddress(const char *path) noexcept {
m_data.constPath = path;
m_type = FileAddressType::ConstPath;
}
FileAddress::~FileAddress() noexcept {
cleanup();
}
FileAddress &FileAddress::operator=(const FileAddress &other) noexcept {
if (this == &other) {
return *this;
@@ -107,16 +98,4 @@ bool FileAddress::operator==(CRStringView path) const noexcept {
return path == p;
}
void FileAddress::cleanup() noexcept {
if (m_type == FileAddressType::Path) {
safeDeleteArray(m_data.path);
clear();
}
}
void FileAddress::clear() noexcept {
m_data.path = nullptr;
m_type = FileAddressType::None;
}
}