summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-05-11 10:47:44 +1200
committerOlly Betts <olly@survex.com>2023-05-17 13:23:16 +1200
commit73872022fb46bf804c0ced2b37b0d84385236cc3 (patch)
treed0c02296a931346274d393a0e2475486e38bbb93 /Lib
parent59fa42a7516a73cbbb1f810603c57ad418145dd2 (diff)
downloadswig-73872022fb46bf804c0ced2b37b0d84385236cc3.tar.gz
[tcl] Add string_view support
See #1567
Diffstat (limited to 'Lib')
-rw-r--r--Lib/tcl/std_string_view.i2
-rw-r--r--Lib/typemaps/std_string_view.swg16
2 files changed, 18 insertions, 0 deletions
diff --git a/Lib/tcl/std_string_view.i b/Lib/tcl/std_string_view.i
new file mode 100644
index 000000000..9d922bccd
--- /dev/null
+++ b/Lib/tcl/std_string_view.i
@@ -0,0 +1,2 @@
+%include <typemaps/std_string_view.swg>
+
diff --git a/Lib/typemaps/std_string_view.swg b/Lib/typemaps/std_string_view.swg
new file mode 100644
index 000000000..eee86306b
--- /dev/null
+++ b/Lib/typemaps/std_string_view.swg
@@ -0,0 +1,16 @@
+//
+// string_view
+//
+
+
+%include <typemaps/std_strings.swg>
+
+%fragment("<string_view>");
+
+namespace std
+{
+ %naturalvar string_view;
+ class string_view;
+}
+
+%typemaps_std_string(std::string_view, char, SWIG_AsCharPtrAndSize, SWIG_FromCharPtrAndSize, %checkcode(STRINGVIEW));