summaryrefslogtreecommitdiff
path: root/src/Str.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Str.zig')
-rw-r--r--src/Str.zig28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/Str.zig b/src/Str.zig
deleted file mode 100644
index 8f49c61..0000000
--- a/src/Str.zig
+++ /dev/null
@@ -1,28 +0,0 @@
-
-const c = @import("c");
-const zpy = @import("root.zig");
-const conversion = zpy.conversion;
-
-const Self = @This();
-
-object: zpy.Object,
-
-pub fn fromString(buffer: []const u8) Self {
- return .{
- .object = .fromPtr(c.PyUnicode_FromStringAndSize(@ptrCast(buffer), @intCast(buffer.len)))
- };
-}
-
-pub fn asUtf8(self: *Self) zpy.Error![]const u8 {
- var size: c.Py_ssize_t = undefined;
- const string: [*]const u8 = c.PyUnicode_AsUTF8AndSize(self.object.ptr, &size);
-
- if (size == -1) return error.Exception;
-
- return string[0..@as(usize, @intCast(size))];
-}
-
-pub fn deinit(self: *Self) void {
- self.object.decref();
- self.* = undefined;
-}