forked from orangeduck/Cello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
String+.h
58 lines (44 loc) · 1.42 KB
/
String+.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
** == String ==
**
** Basic string wrapper
*/
#ifndef StringPlus_h
#define StringPlus_h
#include "Prelude+.h"
#include "Type+.h"
module String;
data {
var type;
char* value;
} StringData;
/** String_New(var self, char* value); */
var String_New(var self, va_list* args);
var String_Delete(var self);
void String_Assign(var self, var obj);
var String_Copy(var self);
var String_Eq(var self, var obj);
var String_Gt(var self, var obj);
var String_Lt(var self, var obj);
int String_Len(var self);
void String_Clear(var self);
var String_Contains(var self, var sub);
void String_Discard(var self, var sub);
long String_Hash(var self);
void String_Parse_Read(var self, var stream);
void String_Parse_Write(var self, var stream);
const char* String_AsStr(var self);
void String_Append(var self, var obj);
void String_Reverse(var self);
instance(String, New) = { sizeof(StringData), String_New, String_Delete };
instance(String, Assign) = { String_Assign };
instance(String, Copy) = { String_Copy };
instance(String, Eq) = { String_Eq };
instance(String, Ord) = { String_Gt, String_Lt };
instance(String, Collection) = { String_Len, String_Clear, String_Contains, String_Discard };
instance(String, Hash) = { String_Hash };
instance(String, Reverse) = { String_Reverse };
instance(String, Parse) = { String_Parse_Read, String_Parse_Write };
instance(String, AsStr) = { String_AsStr };
instance(String, Append) = { String_Append };
#endif