[ox/std] Cleanup
This commit is contained in:
18
deps/ox/src/ox/std/string.hpp
vendored
18
deps/ox/src/ox/std/string.hpp
vendored
@ -139,7 +139,7 @@ class BasicString {
|
|||||||
|
|
||||||
constexpr BasicString &operator+=(Integer_c auto i) noexcept;
|
constexpr BasicString &operator+=(Integer_c auto i) noexcept;
|
||||||
|
|
||||||
constexpr BasicString &operator+=(StringView src) noexcept;
|
constexpr BasicString &operator+=(StringViewCR src) noexcept;
|
||||||
|
|
||||||
constexpr BasicString &operator+=(BasicString const&src) noexcept;
|
constexpr BasicString &operator+=(BasicString const&src) noexcept;
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ class BasicString {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Error append(ox::StringView sv) noexcept {
|
constexpr Error append(StringViewCR sv) noexcept {
|
||||||
return append(sv.data(), sv.size());
|
return append(sv.data(), sv.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -376,7 +376,7 @@ constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::operat
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::operator+=(StringView s) noexcept {
|
constexpr BasicString<SmallStringSize_v> &BasicString<SmallStringSize_v>::operator+=(StringViewCR s) noexcept {
|
||||||
std::size_t strLen = s.bytes();
|
std::size_t strLen = s.bytes();
|
||||||
std::ignore = append(s.data(), strLen);
|
std::ignore = append(s.data(), strLen);
|
||||||
return *this;
|
return *this;
|
||||||
@ -456,7 +456,7 @@ constexpr bool BasicString<SmallStringSize_v>::operator==(const char *other) con
|
|||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
constexpr bool BasicString<SmallStringSize_v>::operator==(OxString_c auto const&other) const noexcept {
|
constexpr bool BasicString<SmallStringSize_v>::operator==(OxString_c auto const&other) const noexcept {
|
||||||
return ox::StringView(*this) == ox::StringView(other);
|
return StringView(*this) == StringView(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t SmallStringSize_v>
|
template<std::size_t SmallStringSize_v>
|
||||||
@ -548,28 +548,28 @@ using StringCR = String const&;
|
|||||||
|
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr ox::String toString(ox::StringViewCR sv) noexcept {
|
constexpr String toString(StringViewCR sv) noexcept {
|
||||||
return ox::String(sv);
|
return ox::String(sv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename PlatSpec, std::size_t SmallStringSize_v>
|
template<typename PlatSpec, std::size_t SmallStringSize_v>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr auto sizeOf(const ox::BasicString<SmallStringSize_v>*) noexcept {
|
constexpr auto sizeOf(BasicString<SmallStringSize_v> const*) noexcept {
|
||||||
VectorMemMap<PlatSpec> v{.smallVecSize = SmallStringSize_v};
|
VectorMemMap<PlatSpec> v{.smallVecSize = SmallStringSize_v};
|
||||||
return sizeOf<PlatSpec>(&v);
|
return sizeOf<PlatSpec>(&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename PlatSpec, std::size_t SmallStringSize_v>
|
template<typename PlatSpec, std::size_t SmallStringSize_v>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr auto alignOf(const ox::BasicString<SmallStringSize_v>&) noexcept {
|
constexpr auto alignOf(BasicString<SmallStringSize_v> const&) noexcept {
|
||||||
VectorMemMap<PlatSpec> v{.smallVecSize = SmallStringSize_v};
|
VectorMemMap<PlatSpec> v{.smallVecSize = SmallStringSize_v};
|
||||||
return alignOf<PlatSpec>(&v);
|
return alignOf<PlatSpec>(&v);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<size_t sz>
|
template<size_t sz>
|
||||||
struct MaybeView<ox::BasicString<sz>> {
|
struct MaybeView<BasicString<sz>> {
|
||||||
using type = ox::StringView;
|
using type = StringView;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user