Fixed tags for mmsource-central
mmsource-1.00-RC1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:41:34 2006 UTC
mmsource-1.00-RC2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:35:20 2006 UTC
mmsource-1.00 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:30:40 2006 UTC
mmsource-1.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:25:09 2006 UTC
mmsource-1.1.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:22:23 2006 UTC
mmsource-1.1.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:14:00 2006 UTC
mmsource-1.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:10:47 2006 UTC
mmsource-1.2.1 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 08:01:35 2006 UTC
mmsource-1.2.2 - Not tagged originally, but eventually done by Scott Ehlert <
[email protected]> on Wed Jul 19 07:57:26 2006 UTC
mmsource-1.2.3 - Not tagged originally, but eventually done by David Anderson <
[email protected]> on Wed Jul 12 17:33:59 2006 UTC
mmsource-1.3 - Originally tagged by Scott Ehlert <
[email protected]> on Thu Aug 17 03:19:55 2006 UTC
mmsource-1.3a - Originally tagged by Scott Ehlert <
[email protected]> on Wed Sep 6 07:17:37 2006 UTC
mmsource-1.3d - Originally tagged by Scott Ehlert <
[email protected]> on Fri Feb 2 05:30:56 2007 UTC
mmsource-1.4 - Originally tagged by Scott Ehlert <
[email protected]> on Sat Apr 7 05:00:28 2007 UTC
mmsource-1.6.0 - Originally tagged by David Anderson <
[email protected]> on Mon Feb 18 23:31:29 2008 UTC
mmsource-1.6.1 - Originally tagged by David Anderson <
[email protected]> on Mon Feb 25 17:15:44 2008 UTC
mmsource-1.6.2 - Originally tagged by David Anderson <
[email protected]> on Sat Jul 26 05:04:35 2008 UTC
1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2008 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): David "BAILOPAN" Anderson
8 * ============================
13 * by the AMX Mod X Development Team
16 #ifndef _INCLUDE_CSTRING_H
17 #define _INCLUDE_CSTRING_H
40 String(const char *src)
47 String(const String &src)
54 bool operator ==(const String &other)
56 return (compare(other.c_str()) == 0);
59 bool operator ==(const char *other)
61 return (compare(other) == 0);
64 const char *c_str() { return v?v:""; }
66 const char *c_str() const { return v?v:""; }
68 void append(const char *t)
70 Grow(size() + strlen(t) + 1);
74 void append(const char c)
82 void append(String &d)
87 void assign(const String &src)
92 void assign(const char *d)
98 Grow(strlen(d) + 1, false);
109 int compare (const char *d) const
112 return strcmp("", d);
117 //Added this for amxx inclusion
137 int find(const char c, int index = 0) const
139 int len = static_cast<int>(size());
142 if (index >= len || index < 0)
145 for (i=index; i<len; i++)
156 int find_last_of(const char c, int index = npos) const
158 int len = static_cast<int>(size());
161 if (index >= len || index < npos)
180 bool is_space(int c) const
182 if (c == '\f' || c == '\n' ||
183 c == '\t' || c == '\r' ||
184 c == '\v' || c == ' ')
199 size_t len = strlen(v);
210 unsigned char c0 = v[0];
214 for (i=0; i<len; i++)
216 if (!is_space(v[i]) || (is_space(v[i]) && ((unsigned char)i==len-1)))
231 if (is_space(v[len-1]))
233 for (i=len-1; i>=0; i--)
236 || (is_space(v[i]) && i==0))
255 void erase(unsigned int start, int num = npos)
262 if (num == npos || start+num > len-start)
265 bool copyflag = false;
266 for (i=0; i<len; i++)
268 if (i>=start && i<start+num)
277 } else if (copyflag) {
290 String substr(unsigned int index, int num = npos) const
302 if (index >= len || !v)
308 } else if (index+num >= len) {
313 unsigned int nslen = num + 2;
317 for (i=index; i<index+num; i++)
328 size_t len = strlen(v);
329 for (i=0; i<len; i++)
331 if (v[i] >= 65 && v[i] <= 90)
336 String & operator = (const String &src)
342 String & operator = (const char *src)
349 char operator [] (unsigned int index) const
351 if (index > size() || !v)
361 if (a < 0 || a >= (int)size() || !v)
367 bool at(int at, char c)
369 if (at < 0 || at >= (int)size() || !v)
378 void Grow(unsigned int d, bool copy=true)
382 char *n = new char[d + 1];
396 static const int npos = -1;
401 #endif //_INCLUDE_CSTRING_H