|
faluco@654
|
1 |
/** |
|
faluco@654
|
2 |
* vim: set ts=4 : |
|
ds@1330
|
3 |
* ============================================================================= |
|
faluco@654
|
4 |
* SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved. |
|
ds@1330
|
5 |
* ============================================================================= |
|
ds@1330
|
6 |
* |
|
ds@1330
|
7 |
* This file is part of the SourceMod/SourcePawn SDK. |
|
faluco@654
|
8 |
* |
|
ds@1330
|
9 |
* This program is free software; you can redistribute it and/or modify it under |
|
ds@1330
|
10 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
ds@1330
|
11 |
* Free Software Foundation. |
|
ds@1330
|
12 |
* |
|
ds@1330
|
13 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
ds@1330
|
14 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
ds@1330
|
15 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
ds@1330
|
16 |
* details. |
|
ds@1330
|
17 |
* |
|
ds@1330
|
18 |
* You should have received a copy of the GNU General Public License along with |
|
ds@1330
|
19 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
ds@1330
|
20 |
* |
|
ds@1330
|
21 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
ds@1330
|
22 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
ds@1330
|
23 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
ds@1330
|
24 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
ds@1330
|
25 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
ds@1330
|
26 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
ds@1330
|
27 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
ds@1330
|
28 |
* or <http://www.sourcemod.net/license.php>. |
|
faluco@654
|
29 |
* |
|
faluco@654
|
30 |
* Version: $Id$ |
|
faluco@654
|
31 |
*/ |
|
faluco@654
|
32 |
|
|
faluco@654
|
33 |
#if defined _keyvalues_included |
|
faluco@654
|
34 |
#endinput |
|
faluco@654
|
35 |
#endif |
|
faluco@654
|
36 |
#define _keyvalues_included |
|
faluco@654
|
37 |
|
|
faluco@654
|
38 |
/** |
|
faluco@654
|
39 |
* KeyValue data value types |
|
faluco@654
|
40 |
*/ |
|
faluco@654
|
41 |
enum KvDataTypes |
|
faluco@654
|
42 |
{ |
|
faluco@654
|
43 |
KvData_None = 0, /**< Type could not be identified, or no type */ |
|
faluco@654
|
44 |
KvData_String, /**< String value */ |
|
faluco@654
|
45 |
KvData_Int, /**< Integer value */ |
|
faluco@654
|
46 |
KvData_Float, /**< Floating point value */ |
|
faluco@654
|
47 |
KvData_Ptr, /**< Pointer value (sometimes called "long") */ |
|
faluco@654
|
48 |
KvData_WString, /**< Wide string value */ |
|
faluco@654
|
49 |
KvData_Color, /**< Color value */ |
|
faluco@654
|
50 |
KvData_UInt64, /**< Large integer value */ |
|
faluco@654
|
51 |
/* --- */ |
|
faluco@654
|
52 |
KvData_NUMTYPES, |
|
faluco@654
|
53 |
}; |
|
faluco@654
|
54 |
|
|
faluco@654
|
55 |
/** |
|
faluco@654
|
56 |
* Creates a new KeyValues structure. The Handle must always be closed. |
|
faluco@654
|
57 |
* |
|
faluco@654
|
58 |
* @param name Name of the root section. |
|
faluco@654
|
59 |
* @param firstKey If non-empty, specifies the first key value. |
|
faluco@654
|
60 |
* @param firstValue If firstKey is non-empty, specifies the first key's value. |
|
faluco@654
|
61 |
* @return A Handle to a new KeyValues structure. |
|
faluco@654
|
62 |
*/ |
|
dvander@725
|
63 |
native Handle:CreateKeyValues(const String:name[], const String:firstkey[]="", const String:firstValue[]=""); |
|
faluco@654
|
64 |
|
|
faluco@654
|
65 |
/** |
|
faluco@654
|
66 |
* Sets a string value of a KeyValues key. |
|
faluco@654
|
67 |
* |
|
faluco@654
|
68 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
69 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
70 |
* @param value String value. |
|
faluco@654
|
71 |
* @noreturn |
|
faluco@654
|
72 |
* @error Invalid Handle. |
|
faluco@654
|
73 |
*/ |
|
faluco@654
|
74 |
native KvSetString(Handle:kv, const String:key[], const String:value[]); |
|
faluco@654
|
75 |
|
|
faluco@654
|
76 |
/** |
|
faluco@654
|
77 |
* Sets an integer value of a KeyValues key. |
|
faluco@654
|
78 |
* |
|
faluco@654
|
79 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
80 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
81 |
* @param value Value number. |
|
faluco@654
|
82 |
* @noreturn |
|
faluco@654
|
83 |
* @error Invalid Handle. |
|
faluco@654
|
84 |
*/ |
|
faluco@654
|
85 |
native KvSetNum(Handle:kv, const String:key[], value); |
|
faluco@654
|
86 |
|
|
faluco@654
|
87 |
/** |
|
faluco@654
|
88 |
* Sets a large integer value of a KeyValues key. |
|
faluco@654
|
89 |
* |
|
faluco@654
|
90 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
91 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
92 |
* @param value Large integer value (0=High bits, 1=Low bits) |
|
faluco@654
|
93 |
* @noreturn |
|
faluco@654
|
94 |
* @error Invalid Handle. |
|
faluco@654
|
95 |
*/ |
|
dvander@816
|
96 |
native KvSetUInt64(Handle:kv, const String:key[], const value[2]); |
|
faluco@654
|
97 |
|
|
faluco@654
|
98 |
/** |
|
faluco@654
|
99 |
* Sets a floating point value of a KeyValues key. |
|
faluco@654
|
100 |
* |
|
faluco@654
|
101 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
102 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
103 |
* @param value Floating point value. |
|
faluco@654
|
104 |
* @noreturn |
|
faluco@654
|
105 |
* @error Invalid Handle. |
|
faluco@654
|
106 |
*/ |
|
faluco@654
|
107 |
native KvSetFloat(Handle:kv, const String:key[], Float:value); |
|
faluco@654
|
108 |
|
|
faluco@654
|
109 |
/** |
|
faluco@654
|
110 |
* Sets a set of color values of a KeyValues key. |
|
faluco@654
|
111 |
* |
|
faluco@654
|
112 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
113 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
114 |
* @param r Red value. |
|
faluco@654
|
115 |
* @param g Green value. |
|
faluco@654
|
116 |
* @param b Blue value. |
|
faluco@654
|
117 |
* @param a Alpha value. |
|
faluco@654
|
118 |
* @noreturn |
|
faluco@654
|
119 |
* @error Invalid Handle. |
|
faluco@654
|
120 |
*/ |
|
faluco@654
|
121 |
native KvSetColor(Handle:kv, const String:key[], r, g, b, a=0); |
|
faluco@654
|
122 |
|
|
faluco@654
|
123 |
/** |
|
faluco@654
|
124 |
* Retrieves a string value from a KeyValues key. |
|
faluco@654
|
125 |
* |
|
faluco@654
|
126 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
127 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
128 |
* @param value Buffer to store key value in. |
|
faluco@654
|
129 |
* @param maxlength Maximum length of the value buffer. |
|
faluco@654
|
130 |
* @param defvalue Optional default value to use if the key is not found. |
|
faluco@654
|
131 |
* @noreturn |
|
faluco@654
|
132 |
* @error Invalid Handle. |
|
faluco@654
|
133 |
*/ |
|
faluco@654
|
134 |
native KvGetString(Handle:kv, const String:key[], String:value[], maxlength, const String:defvalue[]=""); |
|
faluco@654
|
135 |
|
|
faluco@654
|
136 |
/** |
|
faluco@654
|
137 |
* Retrieves an integer value from a KeyValues key. |
|
faluco@654
|
138 |
* |
|
faluco@654
|
139 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
140 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
141 |
* @param defvalue Optional default value to use if the key is not found. |
|
faluco@654
|
142 |
* @return Integer value of the key. |
|
faluco@654
|
143 |
* @error Invalid Handle. |
|
faluco@654
|
144 |
*/ |
|
faluco@654
|
145 |
native KvGetNum(Handle:kv, const String:key[], defvalue=0); |
|
faluco@654
|
146 |
|
|
faluco@654
|
147 |
/** |
|
faluco@654
|
148 |
* Retrieves a floating point value from a KeyValues key. |
|
faluco@654
|
149 |
* |
|
faluco@654
|
150 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
151 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
152 |
* @param defvalue Optional default value to use if the key is not found. |
|
faluco@654
|
153 |
* @return Floating point value of the key. |
|
faluco@654
|
154 |
* @error Invalid Handle. |
|
faluco@654
|
155 |
*/ |
|
faluco@654
|
156 |
native Float:KvGetFloat(Handle:kv, const String:key[], Float:defvalue=0.0); |
|
faluco@654
|
157 |
|
|
faluco@654
|
158 |
/** |
|
faluco@654
|
159 |
* Retrieves a set of color values from a KeyValues key. |
|
faluco@654
|
160 |
* |
|
faluco@654
|
161 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
162 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
163 |
* @param r Red value, set by reference. |
|
faluco@654
|
164 |
* @param g Green value, set by reference. |
|
faluco@654
|
165 |
* @param b Blue value, set by reference. |
|
faluco@654
|
166 |
* @param a Alpha value, set by reference. |
|
faluco@654
|
167 |
* @noreturn |
|
faluco@654
|
168 |
* @error Invalid Handle. |
|
faluco@654
|
169 |
*/ |
|
faluco@654
|
170 |
native KvGetColor(Handle:kv, const String:key[], &r, &g, &b, &a); |
|
faluco@654
|
171 |
|
|
faluco@654
|
172 |
/** |
|
faluco@654
|
173 |
* Retrieves a large integer value from a KeyValues key. |
|
faluco@654
|
174 |
* |
|
faluco@654
|
175 |
* @param kv KeyValues Handle. |
|
dvander@1000
|
176 |
* @param key Name of the key, or NULL_STRING. |
|
faluco@654
|
177 |
* @param value Array to represent the large integer. |
|
faluco@654
|
178 |
* @param defvalue Optional default value to use if the key is not found. |
|
faluco@654
|
179 |
* @noreturn |
|
faluco@654
|
180 |
* @error Invalid Handle. |
|
faluco@654
|
181 |
*/ |
|
dvander@816
|
182 |
native KvGetUInt64(Handle:kv, const String:key[], value[2], defvalue[2]={0,0}); |
|
faluco@654
|
183 |
|
|
faluco@654
|
184 |
/** |
|
faluco@654
|
185 |
* Sets the current position in the KeyValues tree to the given key. |
|
faluco@654
|
186 |
* |
|
faluco@654
|
187 |
* @param kv KeyValues Handle. |
|
faluco@654
|
188 |
* @param key Name of the key. |
|
faluco@654
|
189 |
* @param create If true, and the key does not exist, it will be created. |
|
faluco@654
|
190 |
* @return True if the key exists, false if it does not and was not created. |
|
faluco@654
|
191 |
*/ |
|
faluco@654
|
192 |
native bool:KvJumpToKey(Handle:kv, const String:key[], bool:create=false); |
|
faluco@654
|
193 |
|
|
faluco@654
|
194 |
/** |
|
faluco@654
|
195 |
* Sets the current position in the KeyValues tree to the first sub key. |
|
dvander@753
|
196 |
* This native adds to the internal traversal stack. |
|
faluco@654
|
197 |
* |
|
faluco@654
|
198 |
* @param kv KeyValues Handle. |
|
dvander@753
|
199 |
* @param keyOnly If false, non-keys will be traversed (values). |
|
faluco@654
|
200 |
* @return True on success, false if there was no first sub key. |
|
faluco@654
|
201 |
* @error Invalid Handle. |
|
faluco@654
|
202 |
*/ |
|
dvander@753
|
203 |
native bool:KvGotoFirstSubKey(Handle:kv, bool:keyOnly=true); |
|
faluco@654
|
204 |
|
|
faluco@654
|
205 |
/** |
|
faluco@654
|
206 |
* Sets the current position in the KeyValues tree to the next sub key. |
|
dvander@753
|
207 |
* This native does NOT add to the internal traversal stack, and thus |
|
dvander@753
|
208 |
* KvGoBack() is not needed for each successive call to this function. |
|
faluco@654
|
209 |
* |
|
faluco@654
|
210 |
* @param kv KeyValues Handle. |
|
dvander@753
|
211 |
* @param keyOnly If false, non-keys will be traversed (values). |
|
faluco@654
|
212 |
* @return True on success, false if there was no next sub key. |
|
faluco@654
|
213 |
* @error Invalid Handle. |
|
faluco@654
|
214 |
*/ |
|
dvander@753
|
215 |
native bool:KvGotoNextKey(Handle:kv, bool:keyOnly=true); |
|
dvander@753
|
216 |
|
|
dvander@753
|
217 |
/** |
|
dvander@753
|
218 |
* Saves the current position in the traversal stack onto the traversal |
|
dvander@753
|
219 |
* stack. This can be useful if you wish to use KvGotoNextKey() and |
|
dvander@753
|
220 |
* have the previous key saved for backwards traversal. |
|
dvander@753
|
221 |
* |
|
dvander@753
|
222 |
* @param kv KeyValues Handle. |
|
dvander@753
|
223 |
* @noreturn |
|
dvander@753
|
224 |
* @error Invalid Handle. |
|
dvander@753
|
225 |
*/ |
|
dvander@753
|
226 |
native KvSavePosition(Handle:kv); |
|
faluco@654
|
227 |
|
|
faluco@654
|
228 |
/** |
|
dvander@743
|
229 |
* Removes the given key from the current position. |
|
dvander@743
|
230 |
* |
|
dvander@743
|
231 |
* @param kv KeyValues Handle. |
|
dvander@743
|
232 |
* @param key Name of the key. |
|
dvander@743
|
233 |
* @return True on success, false if key did not exist. |
|
dvander@743
|
234 |
* @error Invalid Handle. |
|
dvander@743
|
235 |
*/ |
|
dvander@743
|
236 |
native bool:KvDeleteKey(Handle:kv, const String:key[]); |
|
dvander@743
|
237 |
|
|
dvander@743
|
238 |
/** |
|
dvander@753
|
239 |
* Removes the current sub-key and attempts to set the position |
|
dvander@753
|
240 |
* to the sub-key after the removed one. If no such sub-key exists, |
|
dvander@753
|
241 |
* the position will be the parent key in the traversal stack. |
|
dvander@753
|
242 |
* Given the sub-key having position "N" in the traversal stack, the |
|
dvander@753
|
243 |
* removal will always take place from position "N-1." |
|
dvander@743
|
244 |
* |
|
dvander@743
|
245 |
* @param kv KeyValues Handle. |
|
dvander@753
|
246 |
* @return 1 if removal succeeded and there was another key. |
|
dvander@753
|
247 |
* 0 if the current node was not contained in the |
|
dvander@753
|
248 |
* previous node, or no previous node exists. |
|
dvander@753
|
249 |
* -1 if removal succeeded and there were no more keys, |
|
dvander@753
|
250 |
* thus the state is as if KvGoBack() was called. |
|
dvander@743
|
251 |
* @error Invalid Handle. |
|
dvander@743
|
252 |
*/ |
|
dvander@753
|
253 |
native KvDeleteThis(Handle:kv); |
|
dvander@743
|
254 |
|
|
dvander@743
|
255 |
/** |
|
faluco@654
|
256 |
* Jumps back to the previous position. Returns false if there are no |
|
faluco@654
|
257 |
* previous positions (i.e., at the root node). This should be called |
|
faluco@654
|
258 |
* once for each successful Jump call, in order to return to the top node. |
|
dvander@753
|
259 |
* This function pops one node off the internal traversal stack. |
|
faluco@654
|
260 |
* |
|
faluco@654
|
261 |
* @param kv KeyValues Handle. |
|
faluco@654
|
262 |
* @return True on success, false if there is no higher node. |
|
faluco@654
|
263 |
* @error Invalid Handle. |
|
faluco@654
|
264 |
*/ |
|
faluco@654
|
265 |
native bool:KvGoBack(Handle:kv); |
|
faluco@654
|
266 |
|
|
faluco@654
|
267 |
/** |
|
faluco@654
|
268 |
* Sets the position back to the top node, emptying the entire node |
|
faluco@654
|
269 |
* traversal history. This can be used instead of looping KvGoBack() |
|
faluco@654
|
270 |
* if recursive iteration is not important. |
|
faluco@654
|
271 |
* |
|
faluco@654
|
272 |
* @param kv KeyValues Handle. |
|
faluco@654
|
273 |
* @noreturn |
|
faluco@654
|
274 |
* @error Invalid Handle. |
|
faluco@654
|
275 |
*/ |
|
faluco@654
|
276 |
native KvRewind(Handle:kv); |
|
faluco@654
|
277 |
|
|
faluco@654
|
278 |
/** |
|
faluco@654
|
279 |
* Retrieves the current section name. |
|
faluco@654
|
280 |
* |
|
faluco@654
|
281 |
* @param kv KeyValues Handle. |
|
faluco@654
|
282 |
* @param section Buffer to store the section name. |
|
faluco@654
|
283 |
* @param maxlength Maximum length of the name buffer. |
|
faluco@654
|
284 |
* @return True on success, false on failure. |
|
faluco@654
|
285 |
* @error Invalid Handle. |
|
faluco@654
|
286 |
*/ |
|
faluco@654
|
287 |
native bool:KvGetSectionName(Handle:kv, String:section[], maxlength); |
|
faluco@654
|
288 |
|
|
faluco@654
|
289 |
/** |
|
faluco@654
|
290 |
* Sets the current section name. |
|
faluco@654
|
291 |
* |
|
faluco@654
|
292 |
* @param kv KeyValues Handle. |
|
faluco@654
|
293 |
* @param section Section name. |
|
faluco@654
|
294 |
* @noreturn |
|
faluco@654
|
295 |
* @error Invalid Handle. |
|
faluco@654
|
296 |
*/ |
|
faluco@654
|
297 |
native KvSetSectionName(Handle:kv, const String:section[]); |
|
faluco@654
|
298 |
|
|
faluco@654
|
299 |
/** |
|
faluco@654
|
300 |
* Returns the data type at a key. |
|
faluco@654
|
301 |
* |
|
faluco@654
|
302 |
* @param kv KeyValues Handle. |
|
faluco@654
|
303 |
* @param key Key name. |
|
faluco@654
|
304 |
* @return KvDataType value of the key. |
|
faluco@654
|
305 |
* @error Invalid Handle. |
|
faluco@654
|
306 |
*/ |
|
faluco@654
|
307 |
native KvDataTypes:KvGetDataType(Handle:kv, const String:key[]); |
|
faluco@654
|
308 |
|
|
faluco@654
|
309 |
/** |
|
faluco@654
|
310 |
* Converts a KeyValues tree to a file. The tree is dumped |
|
faluco@654
|
311 |
* from the current position. |
|
faluco@654
|
312 |
* |
|
faluco@654
|
313 |
* @param kv KeyValues Handle. |
|
faluco@654
|
314 |
* @param file File to dump write to. |
|
faluco@654
|
315 |
* @return True on success, false otherwise. |
|
faluco@654
|
316 |
* @error Invalid Handle. |
|
faluco@654
|
317 |
*/ |
|
faluco@654
|
318 |
native bool:KeyValuesToFile(Handle:kv, const String:file[]); |
|
faluco@654
|
319 |
|
|
faluco@654
|
320 |
/** |
|
faluco@654
|
321 |
* Converts a file to a KeyValues tree. The file is read into |
|
faluco@654
|
322 |
* the current position of the tree. |
|
faluco@654
|
323 |
* |
|
faluco@654
|
324 |
* @param kv KeyValues Handle. |
|
faluco@654
|
325 |
* @param file File to read from. |
|
faluco@654
|
326 |
* @return True on success, false otherwise. |
|
faluco@654
|
327 |
* @error Invalid Handle. |
|
faluco@654
|
328 |
*/ |
|
faluco@654
|
329 |
native bool:FileToKeyValues(Handle:kv, const String:file[]); |
|
faluco@654
|
330 |
|
|
faluco@654
|
331 |
/** |
|
faluco@654
|
332 |
* Sets whether or not the KeyValues parser will read escape sequences. |
|
faluco@654
|
333 |
* For example, \n would be read as a literal newline. This defaults |
|
faluco@654
|
334 |
* to false for new KeyValues structures. |
|
faluco@654
|
335 |
* |
|
faluco@654
|
336 |
* @param kv KeyValues Handle. |
|
faluco@654
|
337 |
* @param useEscapes Whether or not to read escape sequences. |
|
faluco@654
|
338 |
* @noreturn |
|
faluco@654
|
339 |
* @error Invalid Handle. |
|
faluco@654
|
340 |
*/ |
|
faluco@654
|
341 |
native KvSetEscapeSequences(Handle:kv, bool:useEscapes); |
|
dvander@750
|
342 |
|
|
dvander@750
|
343 |
/** |
|
dvander@750
|
344 |
* Returns the position in the jump stack; I.e. the number of calls |
|
dvander@750
|
345 |
* required for KvGoBack to return to the root node. If at the root node, |
|
dvander@750
|
346 |
* 0 is returned. |
|
dvander@750
|
347 |
* |
|
dvander@750
|
348 |
* @param kv KeyValues Handle. |
|
dvander@750
|
349 |
* @return Number of non-root nodes in the jump stack. |
|
dvander@750
|
350 |
* @error Invalid Handle. |
|
dvander@750
|
351 |
*/ |
|
ds@913
|
352 |
native KvNodesInStack(Handle:kv); |
|
faluco@1401
|
353 |
|
|
faluco@1401
|
354 |
/** |
|
faluco@1401
|
355 |
* Makes a new copy of all subkeys in the origin KeyValues to |
|
faluco@1401
|
356 |
* the destination KeyValues. |
|
faluco@1401
|
357 |
* NOTE: All KeyValues are processed from the current location not the root one. |
|
faluco@1401
|
358 |
* |
|
faluco@1401
|
359 |
* @param origin Origin KeyValues Handle. |
|
faluco@1401
|
360 |
* @param dest Destination KeyValues Handlee. |
|
faluco@1401
|
361 |
* @noreturn |
|
faluco@1401
|
362 |
* @error Invalid Handle. |
|
faluco@1401
|
363 |
*/ |
|
faluco@1401
|
364 |
native KvCopySubkeys(Handle:origin, Handle:dest); |
|
faluco@1401
|
365 |
|
|
faluco@1401
|
366 |
/** |
|
faluco@1401
|
367 |
* Finds a KeyValues name by id. |
|
faluco@1401
|
368 |
* |
|
faluco@1401
|
369 |
* @param kv KeyValues Handle. |
|
faluco@1401
|
370 |
* @param id KeyValues id. |
|
faluco@1401
|
371 |
* @param name Buffer to store the name. |
|
faluco@1401
|
372 |
* @param maxlength Maximum length of the value buffer. |
|
faluco@1401
|
373 |
* @return True on success, false if id not found. |
|
faluco@1401
|
374 |
* @error Invalid Handle. |
|
faluco@1401
|
375 |
*/ |
|
faluco@1401
|
376 |
native bool:KvFindKeyById(Handle:kv, id, String:name[], maxlength); |
|
faluco@1401
|
377 |
|
|
faluco@1401
|
378 |
/** |
|
faluco@1401
|
379 |
* Finds a KeyValues id inside a KeyValues tree. |
|
faluco@1401
|
380 |
* |
|
faluco@1401
|
381 |
* @param kv KeyValues Handle. |
|
faluco@1401
|
382 |
* @param key Key name. |
|
faluco@1401
|
383 |
* @param id Id of the found KeyValue. |
|
faluco@1401
|
384 |
* @return True on success, false if key not found. |
|
faluco@1401
|
385 |
* @error Invalid Handle. |
|
faluco@1401
|
386 |
*/ |
|
faluco@1401
|
387 |
native bool:KvGetNameSymbol(Handle:kv, const String:key[], &id); |