[nostalgia,olympic] Rename string len() functions to size()
This commit is contained in:
@@ -192,7 +192,7 @@ void NewMenu::drawLastPageButtons(Context &sctx) noexcept {
|
||||
}
|
||||
|
||||
void NewMenu::finish(Context &sctx) noexcept {
|
||||
if (m_itemName.len() == 0) {
|
||||
if (m_itemName.size() == 0) {
|
||||
oxLogError(ox::Error{1, "New file error: no file name"});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void ProjectExplorer::dirContextMenu(ox::StringViewCR path) const noexcept {
|
||||
if (ImGui::MenuItem("Add Directory")) {
|
||||
addDir.emit(path);
|
||||
}
|
||||
if (path.len() && ImGui::MenuItem("Delete")) {
|
||||
if (path.size() && ImGui::MenuItem("Delete")) {
|
||||
deleteItem.emit(path);
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
|
||||
@@ -40,8 +40,8 @@ constexpr ox::Result<ox::StringView> fileExt(ox::StringViewCR path) noexcept {
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr ox::StringView parentDir(ox::StringView path) noexcept {
|
||||
if (path.len() && path[path.len() - 1] == '/') {
|
||||
path = substr(path, 0, path.len() - 1);
|
||||
if (path.size() && path[path.size() - 1] == '/') {
|
||||
path = substr(path, 0, path.size() - 1);
|
||||
}
|
||||
auto const extStart = ox::find(path.crbegin(), path.crend(), '/').offset();
|
||||
return substr(path, 0, extStart);
|
||||
|
||||
@@ -13,10 +13,10 @@ namespace studio {
|
||||
|
||||
FDFilterItem::FDFilterItem(ox::StringViewCR pName, ox::StringViewCR pSpec) noexcept {
|
||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||
name.resize(pName.len() + 1);
|
||||
ox::strncpy(name.data(), pName.data(), pName.len());
|
||||
spec.resize(pSpec.len() + 1);
|
||||
ox::strncpy(spec.data(), pSpec.data(), pSpec.len());
|
||||
name.resize(pName.size() + 1);
|
||||
ox::strncpy(name.data(), pName.data(), pName.size());
|
||||
spec.resize(pSpec.size() + 1);
|
||||
ox::strncpy(spec.data(), pSpec.data(), pSpec.size());
|
||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user