added StrBreak from AMX Mod X, with various improvements

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40637
This commit is contained in:
David Anderson
2007-03-16 20:10:13 +00:00
parent 632608b5bb
commit 19cfb041aa
4 changed files with 114 additions and 2 deletions
+15 -1
View File
@@ -23,7 +23,7 @@
* and maximum length should have the null terminator INCLUDED in the length. This means
* that this is valid: StrCopy(string, sizeof(string), ...)
*/
/**
* Calculates the length of a string.
*
@@ -159,3 +159,17 @@ native Float:StringToFloat(const String:str[]);
* @return Number of cells written to buffer.
*/
native FloatToString(Float:num, String:str[], maxlength);
/**
* Finds the first "argument" in a string; either a set of space
* terminated characters, or a fully quoted string. After the
* argument is found, whitespace is read until the next portion
* of the string is reached. If nothing remains, -1 is returned.
* Otherwise, the index to the first character is returned.
*
* @param source Source input string.
* @param arg Stores argument read from string.
* @param argLen Maximum length of argument buffer.
* @return Index to next piece of string, or -1 if none.
*/
native StrBreak(const String:source[], String:arg[], argLen);