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