Commit Graph

55 Commits

Author SHA1 Message Date
Willem Jan Palenstijn
9543231685 replace ensureCapacity(_len-1) by ensureCapacity(_len) (fixes bug #1617410)
svn-id: r24865
2006-12-17 19:41:41 +00:00
Gregory Montoir
b2fb23a134 Changed the way String::_storage is initialised, to help GCC 2.95 (see tracker item #1602879)
svn-id: r24793
2006-11-27 00:51:14 +00:00
Max Horn
a6c3257c5e Rewrote class String to use an internal (stack based) storage for small strings, thus avoiding a couple ten thousand heap allocations
svn-id: r24043
2006-09-30 18:55:38 +00:00
Max Horn
53f73eac85 Added explicit string equals/hash functors to a new header common/hash-str.h; removed Hash functor specialization for String and char pointers; changed all code using hashmaps with string keys to explicitly specify whether they honor or ignore case
svn-id: r23634
2006-07-30 12:21:54 +00:00
Max Horn
bd49091afd Added new equals(IgnoreCase) and compareTo(IgnoreCase) methods to class String
svn-id: r23633
2006-07-30 12:17:51 +00:00
Eugene Sandulenko
5b1aaf4ea0 Patch #1503718: "Strange results from Common::computeCapacity"
svn-id: r22998
2006-06-10 07:56:09 +00:00
Max Horn
6d0a06463a Lazily allocate _refCount in class String
svn-id: r22935
2006-06-05 17:36:08 +00:00
Torbjörn Andersson
2e071b59d6 When ensureCapacity() does not have an old string to copy, make sure the newly
allocated one is terminated. Hopefully this will keep the SCUMM save dialog
from randomly adding garbage to my savegame names.

svn-id: r22908
2006-06-04 09:14:07 +00:00
Max Horn
cbe66f3360 Allocate and grow Common::String objects in multiples of 32, and leave at least 16 spare bytes at the end, in case the string grows a little bit.
svn-id: r22896
2006-06-03 16:33:42 +00:00
Travis Howell
179f097202 Fix mingw compile
svn-id: r22835
2006-06-02 13:34:41 +00:00
Eugene Sandulenko
8c7abdf024 Allocate minimum 16 bytes on String(str) call. Reduces 2.500 malloc() calls
on startup

svn-id: r22834
2006-06-02 13:00:27 +00:00
Max Horn
1f07432927 Fixed evil longstanding bug in String::toLowercase & toUppercase: Before modifying the string content, make sure we do not share it with any other string). This should help (hopefully fix) bug #1470892
svn-id: r21931
2006-04-16 09:12:27 +00:00
Max Horn
eb1459334f Tiny optimization for empty strings, which avoids allocating a single byte just to store an empty string (we pass around empty strings in lots of places)
svn-id: r21892
2006-04-14 22:29:51 +00:00
Max Horn
36934b611d Change CVS keywords to SVN keywords
svn-id: r20510
2006-02-11 09:53:53 +00:00
Eugene Sandulenko
ea42bad781 Update copyright notice
svn-id: r20088
2006-01-18 17:39:49 +00:00
Eugene Sandulenko
edfae828f6 Patch #1341626: "New GP32 port"
svn-id: r19710
2005-11-27 02:35:57 +00:00
Eugene Sandulenko
b36677af71 Update FSF address. Eek. Actually that took place on May 1, 2005
svn-id: r19142
2005-10-18 01:30:26 +00:00
Chris Apers
12f40ae777 PalmOS: cannot use global objects in ARM
svn-id: r18962
2005-10-08 19:07:18 +00:00
Eugene Sandulenko
6b4484472b Remove trailing whitespaces.
svn-id: r18604
2005-07-30 21:11:48 +00:00
Max Horn
8b1d7b9166 When including files from common/, explicitly use the common/ prefix
svn-id: r18444
2005-06-24 15:23:51 +00:00
Max Horn
4e66139a4e Added String::hasSuffix and hasPrefix
svn-id: r16744
2005-02-06 19:00:59 +00:00
Max Horn
fcad363886 Get rid of the ConstString class
svn-id: r16564
2005-01-15 21:42:59 +00:00
Max Horn
47280d9433 Updated copyright
svn-id: r16398
2005-01-01 16:09:25 +00:00
Max Horn
0605918ab4 Small tweaks for the String class
svn-id: r14293
2004-07-21 14:20:37 +00:00
Max Horn
4744538752 Added operator + for strings
svn-id: r14093
2004-06-27 23:58:41 +00:00
Max Horn
cb8ca939c2 free(0) is guaranteed to be a no-op
svn-id: r13380
2004-03-25 11:25:50 +00:00
Max Horn
1e18364e5c Fix for bug #896506 (GUI: Invalid read)
svn-id: r12864
2004-02-14 01:12:35 +00:00
Max Horn
033ff78ae9 updated copyright notice
svn-id: r12176
2004-01-06 12:45:34 +00:00
Paweł Kołodziejski
b5a7ef0822 cleanup whitespaces
svn-id: r11219
2003-11-08 22:43:46 +00:00
Max Horn
82aac86edf change (Const)String::c_str to never return 0 (rather return empty string) -> can be used to simplify code. Also don't use stricmp in </<=/>/>= operators, it is inconsisten with == and != operators
svn-id: r11169
2003-11-07 00:02:03 +00:00
Max Horn
9e5c5e292a humpf
svn-id: r10685
2003-10-08 21:09:21 +00:00
Max Horn
cf3ac50e3c add String::lastChar() method
svn-id: r10684
2003-10-08 21:01:50 +00:00
Max Horn
e5c62af78e added String::emptyString constant
svn-id: r10649
2003-10-06 23:19:01 +00:00
Max Horn
0e645f88ae renamed namespace ScummVM to Common
svn-id: r10544
2003-10-02 17:43:02 +00:00
Jonathan Gray
ce42f4d3dd patch #791738 g++ 3.4 compile fix, from Falk Hueffner and a few minor local bits in my tree
svn-id: r9807
2003-08-21 13:39:21 +00:00
Max Horn
0df319e952 #include cleanup (explicityl specify the location for headers from common/, so that we at some point can get rid of -Icommon; exception is made for stdafx.h, since a) we might want to rename it and b) might want to move it to the top level)
svn-id: r9359
2003-08-01 12:21:04 +00:00
Travis Howell
a15dab5fb8 This should be Microsoft Visual C++ only
svn-id: r9355
2003-08-01 05:41:07 +00:00
Jamieson Christian
c5de745580 Disabled unknown pragma warning in MSVC-6.
svn-id: r9320
2003-07-31 06:47:05 +00:00
Max Horn
26d05c0190 the VC warning for unknown pragmas is now gloabally disabled, no need to work around it locally
svn-id: r9300
2003-07-30 18:40:28 +00:00
Max Horn
24005adfd0 pedantic fixes
svn-id: r7789
2003-05-21 16:59:51 +00:00
Paweł Kołodziejski
aa3766018f updated copyrights headers
svn-id: r6726
2003-03-06 21:46:56 +00:00
Paweł Kołodziejski
6ce098172f next pedantic cleanup code
svn-id: r6714
2003-03-06 16:27:06 +00:00
Oliver Kiehl
ebdf89e418 Added some basic line editing to the EditText widget
svn-id: r6393
2003-01-10 21:33:42 +00:00
Max Horn
716c505416 now this was an *EVIL* typo
svn-id: r5668
2002-11-21 16:51:33 +00:00
Max Horn
013cc42e8d operator < and > for String now ignore case
svn-id: r5649
2002-11-21 02:53:49 +00:00
Max Horn
d2156bd26f fix operator == and !=
svn-id: r5570
2002-11-15 17:45:23 +00:00
Max Horn
8a7637cfc1 added methods to String class that convert a string to upper/lower case; changed config class to keep all domains as lower case (fixes bug #scummvm)
svn-id: r5104
2002-10-08 00:11:41 +00:00
Max Horn
94b55db821 patch #612722: MI2 NewGui title fix
svn-id: r5030
2002-09-28 19:25:09 +00:00
Max Horn
09f56dc233 some fixes for the message dialog; added some comments
svn-id: r5021
2002-09-26 12:29:10 +00:00
Max Horn
58e5e0069f added simple message dialog
svn-id: r5020
2002-09-26 11:44:02 +00:00