diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-27 21:23:51 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-12-27 21:23:51 +0100 |
| commit | 1f6eba7bd4b7fc0c5be04f073396b7594a7681c6 (patch) | |
| tree | 950706a557e4c6d2bc41146875558ffeb6735caf /include/ocl/tproc/rope.hpp | |
| parent | cf10b2768d9f17749b9766f9c3f1159ab37a5336 (diff) | |
feat: ocl: add rope.inl, tweaking API.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/ocl/tproc/rope.hpp')
| -rw-r--r-- | include/ocl/tproc/rope.hpp | 92 |
1 files changed, 81 insertions, 11 deletions
diff --git a/include/ocl/tproc/rope.hpp b/include/ocl/tproc/rope.hpp index 968b704..9d9356a 100644 --- a/include/ocl/tproc/rope.hpp +++ b/include/ocl/tproc/rope.hpp @@ -7,28 +7,98 @@ #define __OCL_TPROC_ROPE_HPP #include <ocl/tproc/detail/rope_fwd.hpp> +#include <string> namespace ocl::tproc::rope { - struct reverse_pred; - struct uppercase_pred; - struct lowercase_pred; - struct exact_pred; - struct starts_with_pred; + class reverse_pred + { + std::string cond_; + + public: + reverse_pred(const boost::core::string_view& cond) + : cond_(cond) + { + } + + template <typename It> + It operator()(It begin, It end); + }; + + class uppercase_pred + { + std::string cond_; + + public: + uppercase_pred(const boost::core::string_view& cond) + : cond_(cond) + { + } + + template <typename It> + It operator()(It begin, It end); + }; + + class lowercase_pred + { + std::string cond_; + + public: + lowercase_pred(const boost::core::string_view& cond) + : cond_(cond) + { + } + + template <typename It> + It operator()(It begin, It end); + }; + + class exact_pred + { + std::string cond_; + + public: + exact_pred(const boost::core::string_view& cond) + : cond_(cond) + { + } + + template <typename It> + It operator()(It begin, It end); + }; + + class starts_with_pred + { + std::string cond_; + + public: + starts_with_pred(const boost::core::string_view& cond) + : cond_(cond) + { + } + + template <typename It> + It operator()(It begin, It end); + }; + +} // namespace ocl::tproc::rope + +namespace ocl::tproc +{ template <typename It, class Pred> It find(It begin, It end, Pred); - template <typename It, class Callable> - It find_if(It begin, It end, Callable); + template <typename It, class Pred> + It find_if(It begin, It end, Pred); template <typename It, class Pred> - size_t erase(It begin, It end, Pred); + It::typename size_type erase(It begin, It end, Pred); - template <typename It, class Callable> - size_t erase_if(It begin, It end, Callable); + template <typename It, class Pred> + It::typename size_type erase_if(It begin, It end, Pred); -} // namespace ocl::tproc::rope +} // namespace ocl::tproc #endif // __OCL_TPROC_ROPE_HPP |
