[Scummvm-devel] Make class String case insensitive by default?

Sven Hesse drmccoy at users.sourceforge.net
Sat Jul 22 17:14:13 CEST 2006


Since I'm apparently too stupid to do a proper reply to the list,
Fingolfin will get that mail 2 times now...

On Sat, Jul 22, 2006 at 03:47:57PM +0200, Max Horn wrote:
> Hi,
> 
> I am wondering whether we should turn the comparison operators of  
> class String to be case insensitive by default (that would also  
> affect hash(), of course). Looking through our code, we have to use  
> scummvm_stricmp, or toLowerCase over and over again. So far, I  
> haven't seen any case were we explicitly want case *sensitive*  
> comparisons. Can anybody think of any examples for the latter in our  
> existing code?

The Gob-Engine uses a few compares which could be case-crucial in
parse_v1.cpp/parse_v2.cpp.

Although currently, it also doesn't use the String class at all...
(Once Gobliins 2 works, I plan to do a lot of clean-up)

> Case sensitive compares could still be achieved by using plain  
> strcmp, but I figure by switching the default, we could simplify  
> quite a lot of our code (most engine game detectors, config manager/ 
> file classes, etc.).

I for one think having a method to switch the behaviour, like LordHoto
suggested, would be great.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20060722/6c841fe4/attachment.sig>


More information about the Scummvm-devel mailing list