summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-23 11:03:20 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-23 11:03:20 +0100
commit34ae080c65fef96cc35f7b86c1231b01cb4df8f4 (patch)
treeacfc7a5396739c0d6bee4c6092eb7a58c96e57eb /include
parentcd27850454a7cf15aab598f1fea6a2a6b539e084 (diff)
feat: wip: crope implementation in progress.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/ocl/tproc.hpp8
-rw-r--r--include/ocl/tproc/detail/config.hpp2
-rw-r--r--include/ocl/tproc/detail/rope_fwd.hpp (renamed from include/ocl/tproc/rope_fwd.hpp)31
-rw-r--r--include/ocl/tproc/rope.hpp11
4 files changed, 32 insertions, 20 deletions
diff --git a/include/ocl/tproc.hpp b/include/ocl/tproc.hpp
index 514eb47..a23b91c 100644
--- a/include/ocl/tproc.hpp
+++ b/include/ocl/tproc.hpp
@@ -3,10 +3,10 @@
// 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_HPP
-#define OCL_TPROC_HPP
+#ifndef __OCL_TPROC_HPP
+#define __OCL_TPROC_HPP
#include <ocl/tproc/detail/config.hpp>
-#include <ocl/tproc/rope_fwd.hpp>
+#include <ocl/tproc/rope.hpp>
-#endif // OCL_TPROC_HPP
+#endif // __OCL_TPROC_HPP
diff --git a/include/ocl/tproc/detail/config.hpp b/include/ocl/tproc/detail/config.hpp
index 9b1d265..47bd0b2 100644
--- a/include/ocl/tproc/detail/config.hpp
+++ b/include/ocl/tproc/detail/config.hpp
@@ -14,7 +14,9 @@
#include <ocl/smart_ptr.hpp>
namespace ocl {
+
namespace pmr {}
+
} // namespace ocl
#endif // ifndef __OCL_TPROC_CONFIG
diff --git a/include/ocl/tproc/rope_fwd.hpp b/include/ocl/tproc/detail/rope_fwd.hpp
index 6532d47..e7dbebb 100644
--- a/include/ocl/tproc/rope_fwd.hpp
+++ b/include/ocl/tproc/detail/rope_fwd.hpp
@@ -7,18 +7,19 @@
#define OCL_TPROC_ROPE_FWD_HPP
#include <memory>
-#include <string>
+#include <boost/utility/string_view.hpp>
/// \file rope_fwd.hpp
/// \brief Basic forward definitions of the `rope` type.
namespace ocl {
+
/// \brief This class implements a rope type for any **CharT** type.
/// \note Specializations are available as `crope` and `wrope`.
/// \author Amlal El Mahrouss
template <class CharT, class Traits = std::char_traits<CharT>,
class Allocator = std::allocator<CharT>>
-class basic_rope {
+class basic_rope final {
public:
using traits_type = Traits;
using value_type = CharT;
@@ -29,23 +30,20 @@ public:
using pointer = std::allocator_traits<Allocator>::pointer;
using const_pointer = std::allocator_traits<Allocator>::pointer;
- [[nodiscard]]
- CharT *begin() {
- return nullptr;
- }
+ CharT *begin();
+
+ CharT *end();
- [[nodiscard]]
- CharT *end() {
- return nullptr;
- }
+ size_type size();
- [[nodiscard]]
- size_type size() {
- return 0UL;
- }
+ bool empty() const;
- basic_rope() = default;
- virtual ~basic_rope() = default;
+ ~basic_rope() = default;
+ basic_rope(const boost::string_view& in = {});
+
+private:
+ struct impl;
+ std::unique_ptr<impl> impl_;
};
#if __cplusplus >= 201811L
@@ -56,6 +54,7 @@ using u8rope = basic_rope<char8_t>;
using crope = basic_rope<char>;
using wrope = basic_rope<wchar_t>;
+
} // namespace ocl
#endif
diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp
new file mode 100644
index 0000000..86f1c5e
--- /dev/null
+++ b/include/ocl/tproc/rope.hpp
@@ -0,0 +1,11 @@
+// Copyright 2025, Amlal El Mahrouss (amlal@nekernel.org)
+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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_HPP
+#define __OCL_TPROC_ROPE_HPP
+
+#include <ocl/tproc/detail/rope_fwd.hpp>
+
+#endif // __OCL_TPROC_ROPE_HPP \ No newline at end of file