File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -13,37 +13,6 @@ alias GRND_NONBLOCK: UInt8 = 1
1313
1414alias char_pointer = AnyPointer[c_char]
1515
16-
17- # @value
18- # struct Str:
19- # var vector: List[c_char]
20-
21- # fn __init__(inout self, string: String):
22- # self.vector = List[c_char](capacity=len(string) + 1)
23- # for i in range(len(string)):
24- # self.vector.push_back(ord(string[i]))
25- # self.vector.push_back(0)
26-
27- # fn __init__(inout self, size: Int):
28- # self.vector = List[c_char]()
29- # self.vector.resize(size + 1, 0)
30-
31- # fn __len__(self) -> Int:
32- # for i in range(len(self.vector)):
33- # if self.vector[i] == 0:
34- # return i
35- # return -1
36-
37- # fn to_string(self, size: Int) -> String:
38- # var result: String = ""
39- # for i in range(size):
40- # result += chr(int(self.vector[i]))
41- # return result
42-
43- # fn __enter__(owned self: Self) -> Self:
44- # return self ^
45-
46-
4716# Adapted from https://github.com/crisadamo/mojo-Libc . Huge thanks to Cristian!
4817# C types
4918alias c_void = UInt8
You can’t perform that action at this time.
0 commit comments