From 0d6d23ebc03a70c5a4e3c0f20fd402bfc48d1974 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 27 Dec 2025 12:31:13 +0100 Subject: feat: Improved API and better unit tests. Signed-off-by: Amlal El Mahrouss --- include/ocl/tproc/detail/rope_fwd.hpp | 17 ++++++++++------- include/ocl/tproc/detail/rope_fwd.inl | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/ocl/tproc/detail/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp index 1691f93..912d889 100644 --- a/include/ocl/tproc/detail/rope_fwd.hpp +++ b/include/ocl/tproc/detail/rope_fwd.hpp @@ -3,8 +3,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // Official repository: https://github.com/ocl-org/tproc -#ifndef OCL_TPROC_ROPE_FWD_HPP -#define OCL_TPROC_ROPE_FWD_HPP +#ifndef __OCL_TPROC_ROPE_FWD_HPP +#define __OCL_TPROC_ROPE_FWD_HPP #include @@ -30,17 +30,17 @@ namespace ocl::tproc using pointer = std::allocator_traits::pointer; using const_pointer = std::allocator_traits::pointer; - CharT* begin(); - CharT* end(); + basic_rope& begin(); + basic_rope& end(); - const CharT* cbegin() const; - const CharT* cend() const; + const basic_rope& cbegin() const; + const basic_rope& cend() const; /// \brief Extarcts a needle from a position of n length. basic_rope& substr(size_type pos, const size_type n = 0); /// \brief Rope's version of the find method. - size_type find(const boost::core::string_view& needle); + size_type at(const boost::core::string_view& needle); size_type size(); bool empty() const; @@ -52,6 +52,9 @@ namespace ocl::tproc basic_rope& operator=(basic_rope&& rope); basic_rope(basic_rope&& rope); + public: + static constexpr size_type npos = (size_type)(-1); + private: struct tree_impl; tree_impl* impl_{}; diff --git a/include/ocl/tproc/detail/rope_fwd.inl b/include/ocl/tproc/detail/rope_fwd.inl index b1c5c4e..1d282bb 100644 --- a/include/ocl/tproc/detail/rope_fwd.inl +++ b/include/ocl/tproc/detail/rope_fwd.inl @@ -49,7 +49,7 @@ namespace ocl::tproc basic_rope::basic_rope( basic_rope&& other) { - impl_ = std::exchange(other.impl_); + impl_ = std::exchange(other.impl_); } template -- cgit v1.2.3