From c8f364146e1bfd139d74e4be1b52d4fd66a6d45a Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Thu, 16 May 2024 08:12:47 -0600 Subject: [PATCH 1/2] Adding StringRange --- src/tools/views/views-python.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/views/views-python.hpp b/src/tools/views/views-python.hpp index 2a34260..a3ec6f6 100644 --- a/src/tools/views/views-python.hpp +++ b/src/tools/views/views-python.hpp @@ -2,6 +2,7 @@ #define NJOY_TOOLS_PYTHON_VIEWS // system includes +#include #include // other includes @@ -53,6 +54,7 @@ using UnsignedIntRange = BasicRandomAccessAnyView< unsigned int >; using DoubleRange2D = BasicRandomAccessAnyView< DoubleRange >; using DoubleRange3D = BasicRandomAccessAnyView< DoubleRange2D >; using ComplexRange = BasicRandomAccessAnyView< std::complex< double > >; +using StringRange = BasicRandomAccessAnyView< std::string >; /** * @brief Wrap a BasicBidirectionalAnyView templated on the Element type From 97f6723e69e1a96b21de566f2bbb488b9d2cda5e Mon Sep 17 00:00:00 2001 From: Wim Haeck Date: Thu, 16 May 2024 08:31:29 -0600 Subject: [PATCH 2/2] Wrapping any_view of string --- python/src/tools.python.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/src/tools.python.cpp b/python/src/tools.python.cpp index eda9232..86b7622 100644 --- a/python/src/tools.python.cpp +++ b/python/src/tools.python.cpp @@ -48,5 +48,8 @@ PYBIND11_MODULE( tools, module ) { "any_view< any_view< any_view< double, random_access >, random_access >, random_access >" ); wrapBasicRandomAccessAnyViewOf< std::complex< double > >( viewmodule, - "any_view< std::complex< double , random_access >" ); + "any_view< std::complex< double >, random_access >" ); + wrapBasicRandomAccessAnyViewOf< std::string >( + viewmodule, + "any_view< std::string, random_access >" ); }