mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Cleanup.
This commit is contained in:
@@ -75,21 +75,11 @@ namespace bx
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline StringView::StringView(char* _ptr)
|
|
||||||
{
|
|
||||||
set(_ptr, INT32_MAX);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline StringView::StringView(const char* _ptr)
|
inline StringView::StringView(const char* _ptr)
|
||||||
{
|
{
|
||||||
set(_ptr, INT32_MAX);
|
set(_ptr, INT32_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline StringView::StringView(char* _ptr, int32_t _len)
|
|
||||||
{
|
|
||||||
set(_ptr, _len);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline StringView::StringView(const char* _ptr, int32_t _len)
|
inline StringView::StringView(const char* _ptr, int32_t _len)
|
||||||
{
|
{
|
||||||
set(_ptr, _len);
|
set(_ptr, _len);
|
||||||
@@ -100,17 +90,6 @@ namespace bx
|
|||||||
set(_ptr, _term);
|
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)
|
inline void StringView::set(const char* _ptr)
|
||||||
{
|
{
|
||||||
set(_ptr, INT32_MAX);
|
set(_ptr, INT32_MAX);
|
||||||
@@ -133,12 +112,6 @@ namespace bx
|
|||||||
set(_ptr, int32_t(_term-_ptr) );
|
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)
|
inline void StringView::set(const StringView& _str, int32_t _start, int32_t _len)
|
||||||
{
|
{
|
||||||
const int32_t start = min(_start, _str.m_len);
|
const int32_t start = min(_start, _str.m_len);
|
||||||
|
|||||||
@@ -37,28 +37,15 @@ namespace bx
|
|||||||
///
|
///
|
||||||
StringView& operator=(const StringView& _rhs);
|
StringView& operator=(const StringView& _rhs);
|
||||||
|
|
||||||
///
|
|
||||||
StringView(char* _ptr);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
StringView(const char* _ptr);
|
StringView(const char* _ptr);
|
||||||
|
|
||||||
///
|
|
||||||
StringView(char* _ptr, int32_t _len);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
StringView(const char* _ptr, int32_t _len);
|
StringView(const char* _ptr, int32_t _len);
|
||||||
|
|
||||||
///
|
///
|
||||||
StringView(const char* _ptr, const char* _term);
|
StringView(const char* _ptr, const char* _term);
|
||||||
|
|
||||||
///
|
|
||||||
template<typename Ty>
|
|
||||||
explicit StringView(const Ty& _container);
|
|
||||||
|
|
||||||
///
|
|
||||||
void set(char* _ptr);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
void set(const 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);
|
void set(const StringView& _str, int32_t _start = 0, int32_t _len = INT32_MAX);
|
||||||
|
|
||||||
///
|
|
||||||
template<typename Ty>
|
|
||||||
void set(const Ty& _container);
|
|
||||||
|
|
||||||
///
|
///
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ TEST_CASE("stringPrintfTy", "")
|
|||||||
{
|
{
|
||||||
std::string test;
|
std::string test;
|
||||||
bx::stringPrintf(test, "printf into std::string.");
|
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", "")
|
TEST_CASE("prettify", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user