This commit is contained in:
Бранимир Караџић
2022-09-01 22:00:16 -07:00
parent a82b87c46e
commit d1becf7991
3 changed files with 1 additions and 45 deletions

View File

@@ -75,21 +75,11 @@ namespace bx
return *this;
}
inline StringView::StringView(char* _ptr)
{
set(_ptr, INT32_MAX);
}
inline StringView::StringView(const char* _ptr)
{
set(_ptr, INT32_MAX);
}
inline StringView::StringView(char* _ptr, int32_t _len)
{
set(_ptr, _len);
}
inline StringView::StringView(const char* _ptr, int32_t _len)
{
set(_ptr, _len);
@@ -100,17 +90,6 @@ namespace bx
set(_ptr, _term);
}
template<typename Ty>
inline StringView::StringView(const Ty& _container)
{
set(_container);
}
inline void StringView::set(char* _ptr)
{
set(_ptr, INT32_MAX);
}
inline void StringView::set(const char* _ptr)
{
set(_ptr, INT32_MAX);
@@ -133,12 +112,6 @@ namespace bx
set(_ptr, int32_t(_term-_ptr) );
}
template<typename Ty>
inline void StringView::set(const Ty& _container)
{
set(_container.data(), int32_t(_container.length() ) );
}
inline void StringView::set(const StringView& _str, int32_t _start, int32_t _len)
{
const int32_t start = min(_start, _str.m_len);

View File

@@ -37,28 +37,15 @@ namespace bx
///
StringView& operator=(const StringView& _rhs);
///
StringView(char* _ptr);
///
StringView(const char* _ptr);
///
StringView(char* _ptr, int32_t _len);
///
StringView(const char* _ptr, int32_t _len);
///
StringView(const char* _ptr, const char* _term);
///
template<typename Ty>
explicit StringView(const Ty& _container);
///
void set(char* _ptr);
///
void set(const char* _ptr);
@@ -71,10 +58,6 @@ namespace bx
///
void set(const StringView& _str, int32_t _start = 0, int32_t _len = INT32_MAX);
///
template<typename Ty>
void set(const Ty& _container);
///
void clear();

View File

@@ -16,7 +16,7 @@ TEST_CASE("stringPrintfTy", "")
{
std::string test;
bx::stringPrintf(test, "printf into std::string.");
REQUIRE(0 == bx::strCmp(bx::StringView(test), "printf into std::string.") );
REQUIRE(0 == bx::strCmp(bx::StringView(test.data(), int32_t(test.length() ) ), "printf into std::string.") );
}
TEST_CASE("prettify", "")