This repository has been archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathapi.txt
348 lines (264 loc) · 9.4 KB
/
api.txt
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
Script engine is AngelScript(http://www.angelcode.com/angelscript/)
------------------------PotPlayer's builtin type---------------------------------
intptr
int pointer
uintptr
unsigned pointer
------------------------PotPlayer's builtin API----------------------------------
int HostGetAPIVersion()
Get API version
void HostOpenConsole()
Open debug console
void HostPrintUTF8(const string &in)
Print UTF8 string
void HostPrintUTF16(const string &in)
Print UTF16 string
string HostGetVersion()
Get PotPlayer's version
bool HostCheckVersion(int major, int minor, int build)
Check PotPlayer's version
bool HostIsWin64()
Check PotPlayer is 64bit build or not
void HostSleep(int ms)
win32 API Sleep()
uint HostGetTickCount()
win32 API GetTickCount()
void HostIncTimeOut(int ms)
Increase function timeout time.
bool HostCheckMediaFile(const string &in filename, bool Video, bool Audio, bool Playlist)
Check filename is Video or Audio or Playlist
string HostGetTempFolder()
Get temp folder
string HostGetExtension(const string &in)
Get file extension
string HostMBCSToUTF8(const string &in)
Convert multibyte to UTF8
string HostMBCSToUTF16(const string &in)
Convert multibyte to UTF16
string HostUTF8ToMBCS(const string &in)
Convert UTF8 to multibyte
string HostUTF16ToMBCS(const string &in)
Convert UTF16 to multibyte
string HostUTF8ToUTF16(const string &in)
Convert UTF8 to UTF16
string HostUTF16ToUTF8(const string &in)
Convert UTF16 to UTF8
string HostUrlGetString(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false)
Get or Post HTTP(S) resource
string HostUrlGetStringWithAPI(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false)
Get or Post HTTP(S) resource with API key
uintptr HostOpenHTTP(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false)
Open Get or Post HTTP(S) resource
uintptr HostOpenHTTPWithAPI(const string &in url, const string &in UserAgent = "", const string &in Header = "", const string &in PostData = "", bool NoCookie = false)
Open Get or Post HTTP(S) resource with API key
string HostGetContentHTTP(uintptr http)
Get Content data
string HostGetHeaderHTTP(uintptr http)
Get Header data
int HostGetStatusHTTP(uintptr http)
Get HTTP status code
void HostCloseHTTP(uintptr http)
Close http
uintptr HostFileOpen(const string &in filename)
Open local file
void HostFileClose(uintptr fp)
Close local file
int64 HostFileSeek(uintptr fp, int64 offset, int from = 0)
Seek file's position
int64 HostFileLength(uintptr fp)
Get file length
uint8 HostFileReadBYTE(uintptr fp)
Read uint8
uint16 HostFileReadWORD(uintptr fp)
Read uint16
uint32 HostFileReadDWORD(uintptr fp)
Read uint32
uint64 HostFileReadQWORD(uintptr fp)
Read uint64
string HostFileRead(uintptr fp, int len)
Read string by len
string HostUrlEncode(const string &in url)
Encode Url escape
string HostUrlDecode(const string &in url)
Decode Url escape
string HostBase64Enc(const string &in data)
Encode BASE 64
string HostBase64Dec(const string &in data)
Decode BASE 64
string HostDecompress(const string &in data)
Decompress data(zip or etc...)
string HostGzipCompress(const string &in data)
Compress Gzip
string HostGzipDeflate(const string &in data)
Compress Gzip Deflate
string HostHashMD5(const string &in data)
Get MD5
string HostHashSHA(const string &in data)
Get SHA
string HostHashSHA1(const string &in data)
Get SHA1
string HostHashSHA256(const string &in data)
Get SHA 256
string HostHashSHA384(const string &in data)
Get SHA 384
string HostHashSHA512(const string &in data)
Get SHA 512
bool HostCompareMovieName(const string &in filename1, const string &in filename2)
Compare filename1 with filename2
bool HostSaveString(const string &in key, const string &in val)
Save key, value string to temp storage
string HostLoadString(const string &in key, const string &in def = "")
Load temp key, value string from temp storage
bool HostSaveInteger(const string &in key, int value)
Save key, value integer to temp storage
string int HostLoadInteger(const string &in, int def = 0)
Load temp key, value integer from temp storage
string HostIso639LangName()
Get current ISO639 Language name
string HostIso3166CtryName()
Get current ISO 3166 country name
string HostRegExpParse(const string &in str, const string &in pattern)
const std::regex regex(pattern);
std::cmatch match;
if (std::regex_search(str, match, regex) && match.size() == 2)
{
return std::string(match[1].first, match[1].length());
}
return "";
bool HostRegExpParse(const string &in str, const string &in pattern, array<dictionary> &dic)
const std::regex regex(pattern);
std::cmatch match;
bool ret = std::regex_search(str, match, regex);
if (ret)
{
assign match -> dic ... "first" and "second"
}
return ret;
string HostFixFileName(const string &in filename)
Fix file for create
uintptr HostLoadLibrary(const string &in filename)
win32 API LoadLibrary()
uintptr HostGetProcAddress(uintptr dll, const string &in symbol)
win32 API GetProcAddress()
void HostFreeLibrary(uintptr dll)
win32 API FreeLibrary()
void HostCallProcAsync(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0)
int HostCallProcInt(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0)
uintptr HostCallProcUIntPtr(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0)
uint64 HostCallProcUInt64(uintptr proc, const string &in paramSig, uint64 param1 = 0, uint64 param2 = 0, uint64 param3 = 0, uint64 param4 = 0, uint64 param5 = 0, uint64 param6 = 0)
call dll's function
paramSig -> P: Pointer, Q: int64, W: int16, B: int8, else int32 etc) "PQWI" -> Function(Pointer, int64, int16, int32);
HostCallProcAsync -> Async call
uintptr HostInt2UIntPtr(const int &var)
uintptr HostUInt2UIntPtr(const int &var)
uintptr HostString2UIntPtr(const string &in var)
Get var's pointer
string HostUIntPtr2String(uintptr ptr)
C string(char *) to script string
void HostSetUrlUserAgentHTTP(const string &url, const string &userAgent)
Set useragent for HTTP url
void HostSetUrlHeaderHTTP(const string &url, const string &header)
Set http header for HTTP url
------------------------PotPlayer's builtin class----------------------------------
------------------------string
int replace(const string &in from, const string &in to) const
string Right(int Count) const
string Left(int Count) const
string TrimRight(const string &in str = "") const
string TrimLeft(const string &in = "") const
string Trim(const string &in = "") const
string MakeLower() const
string MakeUpper() const
------------------------jsoncpp
------JsonValue
bool isNull()
bool isBool()
bool isInt()
bool isUInt()
bool isInt64()
bool isUInt64()
bool isFloat()
bool isDouble()
bool isNumeric()
bool isString()
bool isArray()
bool isObject()
bool canString()
int asInt()
uint asUInt()
int64 asInt64()
uint64 asUInt64()
float asFloat()
double asDouble()
bool asBool()
string asString()
int size()
array<string> @getKeys() const
[int]
[string]
------JsonReader
bool parse(string &in json, JsonValue &out root)
------------------------tinyxml2
------XMLAttribute
bool isValid()
bool isBool()
bool isInt()
bool isUInt()
bool isInt64()
bool isDouble()
bool isFloat()
int asInt(int defaultValue = 0)
uint asUInt(uint defaultValue = 0)
int64 asInt64(int64 defaultValue = 0)
float asFloat(float defaultValue = 0)
double asDouble(double defaultValue = 0)
bool asBool(bool defaultValue = false)
string asString()
string Name()
string Value()
XMLAttribute Next()
------XMLElement
bool isValid(const string &in name = "")
bool isBool(const string &in name = "")
bool isInt(const string &in name = "")
bool isUInt(const string &in name = "")
bool isInt64(const string &in name = "")
bool isDouble(const string &in name = "")
bool isFloat(const string &in name = "")
int asInt(const string &in name = "", int defaultValue = 0)
uint asUInt(const string &in name = "", uint defaultValue = 0)
int64 asInt64(const string &in name = "", int64 defaultValue = 0)
float asFloat(const string &in name = "", float defaultValue = 0)
double asDouble(const string &in name = "", double defaultValue = 0)
bool asBool(const string &in name = "", bool defaultValue = false)
string asString(const string &in name = "")
string Name()
string Value()
string Attribute(const string &in name, const string &in value = "")
XMLAttribute FindAttribute(const string &in name)
XMLAttribute FirstAttribute()
XMLElement FirstChildElement(const string &in name = "")
XMLElement NextSiblingElement()
------XMLDocument
bool Parse(string &in xml)
XMLElement FirstChildElement(string &in name = "")
XMLElement RootElement()
------------------------TimXmlRpc
------XmlRpcValue
bool isNull()
bool isBool()
bool isInt()
bool isDouble()
bool isString()
bool isArray()
bool isObject()
bool canString()
int asInt()
double asDouble()
bool asBool()
string asString()
int size()
[int]
[string]
------XmlRpcClient
bool execute(const string &in cmd, const XmlRpcValue &in param, XmlRpcValue &out result)