[ox] Replace C strings in FS with StringView
This commit is contained in:
21
deps/ox/src/ox/fs/filesystem/filelocation.cpp
vendored
21
deps/ox/src/ox/fs/filesystem/filelocation.cpp
vendored
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user