diff --git a/include/bx/inline/string.inl b/include/bx/inline/string.inl index 51271e3..c2658a9 100644 --- a/include/bx/inline/string.inl +++ b/include/bx/inline/string.inl @@ -73,6 +73,11 @@ namespace bx { } + inline StringView::StringView(const StringView& _rhs) + { + set(_rhs); + } + inline StringView::StringView(const StringView& _rhs, int32_t _start, int32_t _len) { set(_rhs, _start, _len); @@ -127,6 +132,11 @@ namespace bx set(_ptr, int32_t(_term-_ptr) ); } + inline void StringView::set(const StringView& _str) + { + set(_str, 0, INT32_MAX); + } + inline void StringView::set(const StringView& _str, int32_t _start, int32_t _len) { const int32_t start = min(_start, _str.m_len); diff --git a/include/bx/string.h b/include/bx/string.h index 5e81400..69ca122 100644 --- a/include/bx/string.h +++ b/include/bx/string.h @@ -61,7 +61,10 @@ namespace bx constexpr StringView(const StringLiteral& _str); /// - StringView(const StringView& _rhs, int32_t _start = 0, int32_t _len = INT32_MAX); + StringView(const StringView& _rhs); + + /// + StringView(const StringView& _rhs, int32_t _start, int32_t _len); /// StringView& operator=(const char* _rhs); @@ -88,7 +91,10 @@ namespace bx void set(const char* _ptr, const char* _term); /// - void set(const StringView& _str, int32_t _start = 0, int32_t _len = INT32_MAX); + void set(const StringView& _str); + + /// + void set(const StringView& _str, int32_t _start, int32_t _len); /// void clear(); diff --git a/tests/string_test.cpp b/tests/string_test.cpp index 96f653f..bce5bd3 100644 --- a/tests/string_test.cpp +++ b/tests/string_test.cpp @@ -584,7 +584,7 @@ TEST_CASE("strWord", "") TEST_CASE("strFindBlock", "") { const bx::StringView test0("{ { {} {} abvgd; {} } }"); - const bx::StringView test1(test0, 1); + const bx::StringView test1(test0, 1, INT32_MAX); bx::StringView result = bx::strFindBlock(test1, '{', '}'); REQUIRE(19 == result.getLength() );