[ox/std] Cleanup
This commit is contained in:
parent
95d9aee0cf
commit
611e2fa7cb
14
deps/ox/src/ox/std/string.hpp
vendored
14
deps/ox/src/ox/std/string.hpp
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015 - 2022 gary@drinkingtea.net
|
* Copyright 2015 - 2023 gary@drinkingtea.net
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(OX_USE_STDLIB)
|
#if __has_include(<string>)
|
||||||
#include <string>
|
#include <string>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ class BasicString {
|
|||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OX_USE_STDLIB
|
#if __has_include(<string>)
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
inline std::string toStdString() const {
|
inline std::string toStdString() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
@ -232,7 +232,7 @@ class BasicString {
|
|||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr BasicString<SmallStringSize_v>::BasicString() noexcept {
|
constexpr BasicString<SmallStringSize_v>::BasicString() noexcept {
|
||||||
if (m_buff.size()) {
|
if (!m_buff.empty()) {
|
||||||
m_buff[0] = 0;
|
m_buff[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
m_buff.push_back(0);
|
m_buff.push_back(0);
|
||||||
@ -242,14 +242,14 @@ constexpr BasicString<SmallStringSize_v>::BasicString() noexcept {
|
|||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr BasicString<SmallStringSize_v>::BasicString(std::size_t cap) noexcept: m_buff(cap + 1) {
|
constexpr BasicString<SmallStringSize_v>::BasicString(std::size_t cap) noexcept: m_buff(cap + 1) {
|
||||||
// GCC complains if you don't do this pretty unnecessary size check
|
// GCC complains if you don't do this pretty unnecessary size check
|
||||||
if (m_buff.size()) {
|
if (!m_buff.empty()) {
|
||||||
m_buff[0] = 0;
|
m_buff[0] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr BasicString<SmallStringSize_v>::BasicString(const char *str) noexcept {
|
constexpr BasicString<SmallStringSize_v>::BasicString(const char *str) noexcept {
|
||||||
if (m_buff.size()) {
|
if (!m_buff.empty()) {
|
||||||
m_buff[0] = 0;
|
m_buff[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
m_buff.push_back(0);
|
m_buff.push_back(0);
|
||||||
@ -259,7 +259,7 @@ constexpr BasicString<SmallStringSize_v>::BasicString(const char *str) noexcept
|
|||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr BasicString<SmallStringSize_v>::BasicString(const char8_t *str) noexcept {
|
constexpr BasicString<SmallStringSize_v>::BasicString(const char8_t *str) noexcept {
|
||||||
if (m_buff.size()) {
|
if (!m_buff.empty()) {
|
||||||
m_buff[0] = 0;
|
m_buff[0] = 0;
|
||||||
} else {
|
} else {
|
||||||
m_buff.push_back(0);
|
m_buff.push_back(0);
|
||||||
|
2
deps/ox/src/ox/std/trace.hpp
vendored
2
deps/ox/src/ox/std/trace.hpp
vendored
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015 - 2022 gary@drinkingtea.net
|
* Copyright 2015 - 2023 gary@drinkingtea.net
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
Loading…
Reference in New Issue
Block a user