added StrCat stock

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40755
This commit is contained in:
David Anderson 2007-05-06 23:35:45 +00:00
parent eb5b94ec44
commit 67a0cdf1c3

View File

@ -208,6 +208,20 @@ native FloatToString(Float:num, String:str[], maxlength);
*/
native StrBreak(const String:source[], String:arg[], argLen);
/**
* 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);
/**
* Returns the number of bytes a character is using. This is
* for multi-byte characters (UTF-8). For normal ASCII characters,
@ -309,4 +323,21 @@ stock CharToLower(chr)
return chr;
}
/**
* Concatenates one string onto another.
*
* @param buffer String to append to.
* @param maxlength Maximum length of entire buffer.
* @param source Source string to concatenate.
* @return Number of bytes written.
*/
stock StrCat(String:buffer[], maxlength, const String:source[])
{
new len = strlen(source);
if (len >= maxlength)
{
return 0;
}
return Format(buffer[len], maxlength-len, "%s", source);
}