core/sm_stringutil.h
author David Anderson <dvander@alliedmods.net>
Tue May 22 20:50:48 2007 +0000 (2007-05-22)
changeset 833 732bedfcbe3e
parent 728 8761b23853fc
child 1231 17badaf66ce4
permissions -rw-r--r--
added ReplaceString and ReplaceStringEx (phew!)
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  * This file is not open source and may not be copied without explicit
     8  * written permission of AlliedModders LLC.  This file may not be redistributed 
     9  * in whole or significant part.
    10  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_STRINGUTIL_H_
    16 #define _INCLUDE_SOURCEMOD_STRINGUTIL_H_
    17 
    18 #include <math.h>
    19 #include "sp_vm_api.h"
    20 #include "sp_typeutil.h"
    21 
    22 using namespace SourcePawn;
    23 
    24 #define LANG_SERVER		0
    25 
    26 #define IS_STR_FILLED(var) (var[0] != '\0')
    27 
    28 size_t atcprintf(char *buffer, size_t maxlen, const char *format, IPluginContext *pCtx, const cell_t *params, int *param);
    29 const char *stristr(const char *str, const char *substr);
    30 unsigned int strncopy(char *dest, const char *src, size_t count);
    31 size_t gnprintf(char *buffer, size_t maxlen, const char *format, void **args);
    32 size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...);
    33 size_t UTIL_FormatArgs(char *buffer, size_t maxlength, const char *fmt, va_list ap);
    34 char *sm_strdup(const char *str);
    35 size_t CorePlayerTranslate(int client, char *buffer, size_t maxlength, const char *phrase, void **params);
    36 unsigned int UTIL_ReplaceAll(char *subject, size_t maxlength, const char *search, const char *replace);
    37 char *UTIL_ReplaceEx(char *subject, size_t maxLen, const char *search, size_t searchLen, const char *replace, size_t replaceLen);
    38 
    39 #endif // _INCLUDE_SOURCEMOD_STRINGUTIL_H_