Compare commits
2 Commits
dfd27afd67
...
84205879d4
Author | SHA1 | Date | |
---|---|---|---|
84205879d4 | |||
ebf3a6961e |
16
deps/ox/src/ox/std/string.hpp
vendored
16
deps/ox/src/ox/std/string.hpp
vendored
@ -15,6 +15,7 @@
|
||||
#include "algorithm.hpp"
|
||||
#include "memops.hpp"
|
||||
#include "serialize.hpp"
|
||||
#include "stringliteral.hpp"
|
||||
#include "stringview.hpp"
|
||||
#include "strops.hpp"
|
||||
#include "vector.hpp"
|
||||
@ -41,6 +42,8 @@ class BasicString {
|
||||
|
||||
constexpr BasicString(const char *str, std::size_t size) noexcept;
|
||||
|
||||
constexpr explicit BasicString(StringLiteral const&str) noexcept;
|
||||
|
||||
constexpr explicit BasicString(CRStringView str) noexcept;
|
||||
|
||||
constexpr explicit BasicString(BasicString const&) noexcept;
|
||||
@ -250,14 +253,6 @@ constexpr BasicString<SmallStringSize_v>::BasicString(std::size_t cap) noexcept:
|
||||
}
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
template<size_t Sz>
|
||||
constexpr BasicString<SmallStringSize_v>::BasicString(char const (&str)[Sz]) noexcept {
|
||||
m_buff.resize(Sz + 1);
|
||||
ox::listcpy(m_buff.data(), str, Sz);
|
||||
m_buff[Sz] = 0;
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v>::BasicString(const char *str) noexcept {
|
||||
if (!m_buff.empty()) {
|
||||
@ -285,6 +280,11 @@ constexpr BasicString<SmallStringSize_v>::BasicString(const char *str, std::size
|
||||
m_buff[size] = 0;
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v>::BasicString(StringLiteral const&str) noexcept:
|
||||
BasicString(StringView{str.data(), str.bytes()}) {
|
||||
}
|
||||
|
||||
template<std::size_t SmallStringSize_v>
|
||||
constexpr BasicString<SmallStringSize_v>::BasicString(CRStringView str) noexcept {
|
||||
if (m_buff.empty()) {
|
||||
|
@ -19,7 +19,9 @@ class ItemMaker {
|
||||
ox::String const parentDir;
|
||||
ox::String const fileExt;
|
||||
constexpr explicit ItemMaker(
|
||||
ox::StringView pName, ox::StringView pParentDir, ox::CRStringView pFileExt) noexcept:
|
||||
ox::StringView pName,
|
||||
ox::StringView pParentDir,
|
||||
ox::StringView pFileExt) noexcept:
|
||||
typeName(pName),
|
||||
parentDir(pParentDir),
|
||||
fileExt(pFileExt) {
|
||||
@ -62,7 +64,7 @@ class ItemMakerT: public ItemMaker {
|
||||
T pItem,
|
||||
ox::ClawFormat pFmt) noexcept:
|
||||
ItemMaker(pDisplayName, pParentDir, fileExt),
|
||||
m_item(pItem),
|
||||
m_item(std::move(pItem)),
|
||||
m_fmt(pFmt) {
|
||||
}
|
||||
constexpr ItemMakerT(
|
||||
|
Loading…
x
Reference in New Issue
Block a user