diff options
| -rw-r--r-- | include/ocl/tproc.hpp | 2 | ||||
| -rw-r--r-- | include/ocl/tproc/detail/config.hpp | 6 | ||||
| -rw-r--r-- | include/ocl/tproc/rope.hpp | 0 | ||||
| -rw-r--r-- | include/ocl/tproc/rope_fwd.hpp | 61 | ||||
| -rw-r--r-- | test/rope_test/.keep | 0 | ||||
| -rw-r--r-- | test/rope_test/crope.test.cpp | 7 |
6 files changed, 72 insertions, 4 deletions
diff --git a/include/ocl/tproc.hpp b/include/ocl/tproc.hpp index 84a2851..514eb47 100644 --- a/include/ocl/tproc.hpp +++ b/include/ocl/tproc.hpp @@ -7,6 +7,6 @@ #define OCL_TPROC_HPP #include <ocl/tproc/detail/config.hpp> -#include <ocl/tproc/rope.hpp> +#include <ocl/tproc/rope_fwd.hpp> #endif // OCL_TPROC_HPP diff --git a/include/ocl/tproc/detail/config.hpp b/include/ocl/tproc/detail/config.hpp index 60e5278..9b1d265 100644 --- a/include/ocl/tproc/detail/config.hpp +++ b/include/ocl/tproc/detail/config.hpp @@ -9,12 +9,12 @@ #define __OCL_TPROC_CONFIG #include <ocl/detail/config.hpp> -#include <ocl/is_same.hpp> +#include <ocl/equiv.hpp> #include <ocl/option.hpp> #include <ocl/smart_ptr.hpp> namespace ocl { -template <typename CharT> class basic_rope; -} +namespace pmr {} +} // namespace ocl #endif // ifndef __OCL_TPROC_CONFIG diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp deleted file mode 100644 index e69de29..0000000 --- a/include/ocl/tproc/rope.hpp +++ /dev/null diff --git a/include/ocl/tproc/rope_fwd.hpp b/include/ocl/tproc/rope_fwd.hpp new file mode 100644 index 0000000..323674f --- /dev/null +++ b/include/ocl/tproc/rope_fwd.hpp @@ -0,0 +1,61 @@ +// 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_FWD_HPP +#define OCL_TPROC_ROPE_FWD_HPP + +#include <memory> +#include <string> + +/// \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 { +public: + using traits_type = Traits; + using value_type = CharT; + using allocator_type = Allocator; + using size_type = std::allocator_traits<Allocator>::size_type; + using reference = CharT &; + using const_reference = const CharT &; + using pointer = std::allocator_traits<Allocator>::pointer; + using const_pointer = std::allocator_traits<Allocator>::pointer; + + [[nodiscard]] + CharT *begin() { + return nullptr; + } + + [[nodiscard]] + CharT *end() { + return nullptr; + } + + [[nodiscard]] + size_type size() { + return 0UL; + } + + basic_rope() = default; + virtual ~basic_rope() = default; +}; + +#if __cplusplus >= 201811L +#ifdef __cpp_char8_t +using u8rope = basic_rope<char8_t>; +#endif +#endif + +using crope = basic_rope<char>; +using wrope = basic_rope<wchar_t>; +} // namespace ocl + +#endif
\ No newline at end of file diff --git a/test/rope_test/.keep b/test/rope_test/.keep deleted file mode 100644 index e69de29..0000000 --- a/test/rope_test/.keep +++ /dev/null diff --git a/test/rope_test/crope.test.cpp b/test/rope_test/crope.test.cpp new file mode 100644 index 0000000..869331f --- /dev/null +++ b/test/rope_test/crope.test.cpp @@ -0,0 +1,7 @@ +/* + * File: crope.test.cpp + * Purpose: Char rope test. + * Author: Amlal El Mahrouss (amlal@nekernel.org) + * Copyright 2025, Amlal El Mahrouss, licensed under the Boost Software License. + */ + |
