Skip to content

Commit

Permalink
Fixed merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellbelove committed Nov 30, 2024
1 parent ed8321e commit 1b76d93
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 181 deletions.
89 changes: 0 additions & 89 deletions include/etl/basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -727,47 +727,6 @@ namespace etl
assign(view.begin(), view.end());
}

//*********************************************************************
/// Assigns values to the string.
/// Truncates if the string does not have enough free space.
///\param other The other string.
//*********************************************************************
void assign(const_pointer other)
{
assign(other, other + etl::strlen(other));
}

//*********************************************************************
/// Assigns values to the string.
/// Truncates if the string does not have enough free space.
///\param other The other string.
///\param length The length to copy.
//*********************************************************************
void assign(const_pointer other, size_type length_)
{
assign(other, other + length_);
}

//*********************************************************************
/// Assigns values to the string from a view.
//*********************************************************************
template <typename TTraits>
void assign(const etl::basic_string_view<T, TTraits>& view)
{
assign(view.begin(), view.end());
}

#if ETL_USING_STL && ETL_USING_CPP17
//*********************************************************************
/// Assigns values to the string from a view.
//*********************************************************************
template <typename TTraits>
void assign(const std::basic_string_view<T, TTraits>& view)
{
assign(view.begin(), view.end());
}
#endif

//*********************************************************************
/// Assigns values to the string.
/// Truncates if the string does not have enough free space.
Expand Down Expand Up @@ -1438,30 +1397,6 @@ namespace etl
return find_impl(view.begin(), view.end(), view.size(), pos);
}

//*********************************************************************
/// Find content within the string
///\param view The content to find
///\param pos The position to start searching from.
//*********************************************************************
template <typename TTraits>
size_type find(const etl::basic_string_view<T, TTraits>& view, size_type pos = 0) const
{
return find_impl(view.begin(), view.end(), view.size(), pos);
}

#if ETL_USING_STL && ETL_USING_CPP17
//*********************************************************************
/// Find content within the string
///\param view The content to find
///\param pos The position to start searching from.
//*********************************************************************
template <typename TTraits>
size_type find(const std::basic_string_view<T, TTraits>& view, size_type pos = 0) const
{
return find_impl(view.begin(), view.end(), view.size(), pos);
}
#endif

//*********************************************************************
/// Find content within the string
///\param s Pointer to the content to find
Expand Down Expand Up @@ -1527,30 +1462,6 @@ namespace etl
return rfind_impl(view.rbegin(), view.rend(), view.size(), pos);
}

//*********************************************************************
/// Find content within the string
///\param view The content to find
///\param pos The position to start searching from.
//*********************************************************************
template <typename TTraits>
size_type rfind(const etl::basic_string_view<T, TTraits>& view, size_type pos = 0) const
{
return rfind_impl(view.rbegin(), view.rend(), view.size(), pos);
}

#if ETL_USING_STL && ETL_USING_CPP17
//*********************************************************************
/// Find content within the string
///\param view The content to find
///\param pos The position to start searching from.
//*********************************************************************
template <typename TTraits>
size_type rfind(const std::basic_string_view<T, TTraits>& view, size_type pos = 0) const
{
return rfind_impl(view.rbegin(), view.rend(), view.size(), pos);
}
#endif

//*********************************************************************
/// Find content within the string
///\param str The content to find
Expand Down
12 changes: 0 additions & 12 deletions include/etl/string_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,6 @@ namespace etl
{
}

#if ETL_USING_STL && ETL_USING_CPP17
//*************************************************************************
/// Constructor from std::basic string_view
//*************************************************************************
template <typename TStdTraits>
explicit ETL_CONSTEXPR basic_string_view(const std::basic_string_view<T, TStdTraits>& other) ETL_NOEXCEPT
: mbegin(other.data())
, mend(other.data() + other.size())
{
}
#endif

//*************************************************************************
/// Returns a const reference to the first element.
//*************************************************************************
Expand Down
80 changes: 0 additions & 80 deletions test/test_string_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,86 +169,6 @@ namespace
CHECK(isEqual);
}

#if ETL_USING_STL && ETL_USING_CPP17
//*************************************************************************
TEST(test_constructor_from_std_string_view)
{
std::string_view stdview(text.data(), text.size());

View view(stdview);

CHECK(stdview.size() == view.size());
CHECK(stdview.size() == view.max_size());

bool isEqual = std::equal(view.begin(), view.end(), stdview.begin());
CHECK(isEqual);
}
#endif

#if ETL_USING_STL && ETL_USING_CPP17
//*************************************************************************
TEST(test_constructor_from_std_wstring_view)
{
std::wstring_view stdview(wtext.data(), wtext.size());

WView view(stdview);

CHECK(stdview.size() == view.size());
CHECK(stdview.size() == view.max_size());

bool isEqual = std::equal(view.begin(), view.end(), stdview.begin());
CHECK(isEqual);
}
#endif

#if ETL_USING_STL && ETL_USING_CPP20
//*************************************************************************
TEST(test_constructor_from_std_u8string_view)
{
std::u8string_view stdview(u8text.begin(), u8text.end());

U8View view(stdview);

CHECK(stdview.size() == view.size());
CHECK(stdview.size() == view.max_size());

bool isEqual = std::equal(view.begin(), view.end(), stdview.begin());
CHECK(isEqual);
}
#endif

#if ETL_USING_STL && ETL_USING_CPP17
//*************************************************************************
TEST(test_constructor_from_std_u16string_view)
{
std::u16string_view stdview(u16text.data(), u16text.size());

U16View view(stdview);

CHECK(stdview.size() == view.size());
CHECK(stdview.size() == view.max_size());

bool isEqual = std::equal(view.begin(), view.end(), stdview.begin());
CHECK(isEqual);
}
#endif

#if ETL_USING_STL && ETL_USING_CPP17
//*************************************************************************
TEST(test_constructor_from_std_u32string_view)
{
std::u32string_view stdview(u32text.data(), u32text.size());

U32View view(stdview);

CHECK(stdview.size() == view.size());
CHECK(stdview.size() == view.max_size());

bool isEqual = std::equal(view.begin(), view.end(), stdview.begin());
CHECK(isEqual);
}
#endif

//*************************************************************************
TEST(test_constructor_pointer_size)
{
Expand Down

0 comments on commit 1b76d93

Please sign in to comment.