summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-27 12:31:13 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-27 12:32:02 +0100
commit0d6d23ebc03a70c5a4e3c0f20fd402bfc48d1974 (patch)
tree8ea8bb668dcb21c70299da70a4e5576639e6aa67 /include
parentcd42a4117b4260f9521b68c1cadabfadd9a61049 (diff)
feat: Improved API and better unit tests.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/ocl/tproc/detail/rope_fwd.hpp17
-rw-r--r--include/ocl/tproc/detail/rope_fwd.inl2
2 files changed, 11 insertions, 8 deletions
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 <ocl/tproc/detail/config.hpp>
@@ -30,17 +30,17 @@ namespace ocl::tproc
using pointer = std::allocator_traits<Allocator>::pointer;
using const_pointer = std::allocator_traits<Allocator>::pointer;
- CharT* begin();
- CharT* end();
+ basic_rope<CharT, Traits, Allocator>& begin();
+ basic_rope<CharT, Traits, Allocator>& end();
- const CharT* cbegin() const;
- const CharT* cend() const;
+ const basic_rope<CharT, Traits, Allocator>& cbegin() const;
+ const basic_rope<CharT, Traits, Allocator>& cend() const;
/// \brief Extarcts a needle from a position of n length.
basic_rope<CharT, Traits, Allocator>& 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<CharT, Traits, Allocator>::basic_rope(
basic_rope<CharT, Traits, Allocator>&& other)
{
- impl_ = std::exchange(other.impl_);
+ impl_ = std::exchange(other.impl_);
}
template <class CharT, class Traits, class Allocator>