1.1 --- a/plugins/include/string.inc Mon Jan 29 22:34:53 2007 +0000
1.2 +++ b/plugins/include/string.inc Mon Jan 29 22:35:06 2007 +0000
1.3 @@ -64,8 +64,8 @@
1.4 * @param str1 First string (left).
1.5 * @param str2 Second string (right).
1.6 * @param caseSensitive If true (default), comparison is case sensitive.
1.7 - * If false, comparison is case insensitive.
1.8 - * @return True if equal, false otherwise.
1.9 + * If false, comparison is case insensitive.
1.10 + * @return True if equal, false otherwise.
1.11 */
1.12 stock bool:StrEqual(const String:str1[], const String:str2[], bool:caseSensitive=true)
1.13 {
1.14 @@ -80,7 +80,7 @@
1.15 * @param dest Destination string buffer to copy to.
1.16 * @param destlen Destination buffer length (includes null terminator).
1.17 * @param source Source string buffer to copy from.
1.18 - * @return Number of cells written.
1.19 + * @return Number of cells written.
1.20 */
1.21 native StrCopy(String:dest[], destLen, const String:source[]);
1.22
1.23 @@ -91,7 +91,7 @@
1.24 * @param maxlength Maximum length of output string buffer.
1.25 * @param format Formatting rules.
1.26 * @param ... Variable number of format parameters.
1.27 - * @return Number of cells written.
1.28 + * @return Number of cells written.
1.29 */
1.30 native Format(String:buffer[], maxlength, const String:format[], {Handle,Float,String,_}:...);
1.31
1.32 @@ -104,16 +104,31 @@
1.33 * @param maxlength Maximum length of output string buffer.
1.34 * @param format Formatting rules.
1.35 * @param ... Variable number of format parameters.
1.36 - * @return Number of cells written.
1.37 + * @return Number of cells written.
1.38 */
1.39 native FormatEx(String:buffer[], maxlength, const String:format[], {Handle,Float,String,_}:...);
1.40
1.41 /**
1.42 + * Formats a string according to the SourceMod format rules (see documentation).
1.43 + * @note This is the same as Format(), except it grabs parameters from a parent parameter
1.44 + * stack, rather than a local. This is useful for implementing your own variable argument
1.45 + * functions.
1.46 + *
1.47 + * @param buffer Destination string buffer.
1.48 + * @param maxlength Maximum length of output string buffer.
1.49 + * @param format Formatting rules.
1.50 + * @param varpos Argument number which contains the '...' symbol.
1.51 + * Note: Arguments start at 1.
1.52 + * @return Number of bytes written.
1.53 + */
1.54 +native VFormat(String:buffer[], maxlength, const String:format[], varpos);
1.55 +
1.56 +/**
1.57 * Converts a string to an integer.
1.58 *
1.59 * @param str String to convert.
1.60 - * @param nBase Numerical base to use. 10 is default.
1.61 - * @return Integer conversion of string, or 0 on failure.
1.62 + * @param nBase Numerical base to use. 10 is default.
1.63 + * @return Integer conversion of string, or 0 on failure.
1.64 */
1.65 native StringToInt(const String:str[], nBase=10);
1.66
1.67 @@ -123,7 +138,7 @@
1.68 * @param str Buffer to store string in.
1.69 * @param maxlength Maximum length of string buffer.
1.70 * @param num Integer to convert.
1.71 - * @return Number of cells written to buffer.
1.72 + * @return Number of cells written to buffer.
1.73 */
1.74 native IntToString(String:str[], maxlength, num);
1.75
1.76 @@ -131,7 +146,7 @@
1.77 * Converts a string to a floating point number.
1.78 *
1.79 * @param str String to convert to a foat.
1.80 - * @return Floating point result, or 0.0 on error.
1.81 + * @return Floating point result, or 0.0 on error.
1.82 */
1.83 native Float:StringToFloat(const String:str[]);
1.84
1.85 @@ -141,6 +156,6 @@
1.86 * @param str Buffer to store string in.
1.87 * @param maxlength Maximum length of string buffer.
1.88 * @param num Floating point number to convert.
1.89 - * @return Number of cells written to buffer.
1.90 + * @return Number of cells written to buffer.
1.91 */
1.92 native FloatToString(String:str[], maxlength, Float:num);