added StrCat stock
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40755
This commit is contained in:
parent
eb5b94ec44
commit
67a0cdf1c3
@ -208,6 +208,20 @@ native FloatToString(Float:num, String:str[], maxlength);
|
|||||||
*/
|
*/
|
||||||
native StrBreak(const String:source[], String:arg[], argLen);
|
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
|
* Returns the number of bytes a character is using. This is
|
||||||
* for multi-byte characters (UTF-8). For normal ASCII characters,
|
* for multi-byte characters (UTF-8). For normal ASCII characters,
|
||||||
@ -309,4 +323,21 @@ stock CharToLower(chr)
|
|||||||
return 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);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user