summaryrefslogtreecommitdiff
path: root/meta/template/string.lua
blob: 1e5ad5a3d82ca2ffba4e9e6642e0d706a52a9e27 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---@meta

---#DES 'string'
---@class string*
string = {}

---#DES 'string.byte'
---@param s  string
---@param i? integer
---@param j? integer
---@return integer
---@return ...
function string.byte(s, i, j) end

---#DES 'string.char'
---@param byte integer
---@vararg integer
---@return string
---@return ...
function string.char(byte, ...) end

---#DES 'string.dump'
---@param f      function
---@param strip? boolean
---@return string
function string.dump(f, strip) end

---#DES 'string.find'
---@param s       string
---@param pattern string
---@param init?   integer
---@param plain?  boolean
---@return integer start
---@return integer end
---@return ... captured
function string.find(s, pattern, init, plain) end

---#DES 'string.format'
---@param s string
---@vararg string
---@return string
function string.format(s, ...) end

---#DES 'string.gmatch'
---#if VERSION <= 5.3 then
---@param s       string
---@param pattern string
---@return fun():string, ...
function string.gmatch(s, pattern) end
---#else
---@param s       string
---@param pattern string
---@param init?   integer
---@return fun():string, ...
function string.gmatch(s, pattern, init) end
---#end

---#DES 'string.gsub'
---@param s       string
---@param pattern string
---@param repl    string|table|function
---@param n       integer
---@return string
---@return integer count
function string.gsub(s, pattern, repl, n) end

---#DES 'string.len'
---@param s string
---@return integer
function string.len(s) end

---#DES 'string.lower'
---@param s string
---@return string
function string.lower(s) end

---#DES 'string.match'
---@param s       string
---@param pattern string
---@param init?   integer
---@return string captured
function string.match(s, pattern, init) end

---@version >5.3
---#DES 'string.pack'
---@param fmt string
---@param v1  string
---@param v2? string
---@vararg string
---@return string binary
function string.pack(fmt, v1, v2, ...) end

---@version >5.3
---#DES 'string.packsize'
---@param fmt string
---@return integer
function string.packsize(fmt) end

---#if VERSION <= 5.1 then
---#DES 'string.rep<5.1'
---@param s    string
---@param n    integer
---@return string
function string.rep(s, n) end
---#else
---#DES 'string.rep>5.2'
---@param s    string
---@param n    integer
---@param sep? string
---@return string
function string.rep(s, n, sep) end
---#end

---#DES 'string.reverse'
---@param s string
---@return string
function string.reverse(s) end

---#DES 'string.sub'
---@param s  string
---@param i  integer
---@param j? integer
---@return string
function string.sub(s, i, j) end

---@version >5.3
---#DES 'string.unpack'
---@param fmt  string
---@param s    string
---@param pos? integer
---@return ...
---@return integer offset
function string.unpack(fmt, s, pos) end

---#DES 'string.upper'
---@param s string
---@return string
function string.upper(s) end

return string