[wx-dev] Re: case insensitive find() in wxString

Jorgen Bodde jorgen.maillist at gmail.com
Wed Aug 2 04:20:17 PDT 2006


Why not write a wxStringUtils class that can manipulate a wxString class by
introducing all the functionality that a std::string does not have. This way
you can extend all you want, but not pollute wxString too much, and it can
be used on std::string and wxString in the most effective way.

With regards,
- Jorgen

On 8/2/06, Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:
>
> Robert Roebling ha scritto:
> >>> FM> This patch would allow to append the "caseCompare cmp =3D exact"
> argument
> >>> FM> to various functions (e.g. Contains, Replace, After/Before
> First/Last,
> >>> FM> StartsWith / EndsWith). Specially for wxString::Contains and
> Replace()
> >>> FM> that would be very useful IMO.
> >>> ....
> >>> FM> What's your opinion ?
> >>>
> >>>  To be honest, I'm undecided. On one hand, I do see how could this be
> >>> useful. OTOH we plan to switch to std::string at some moment in the
> future
> >>> and adding yet more features which the standard class doesn't have is
> going
> >>> to make switching even more difficult.
> >> BTW, why should we switch to std::string in future ?
> >
> > I'm not in favor of that, either, but it has been a request many
> > time already.
> sorry - you mean you're not in favour to switch to std::string or to
> implement more widely case-insensitive functions support ?
>
> > But what I'm actually wondering is how you handle
> > Unicode uppercase. It is easy for a-z, but even Westeuropean
> > languages have more letters than these. Is there a native function
> > for that or an algorithm etc?
> good point. I thought to use wxTolower as all case insensitive wxString
> functions currently do... I see that GNU libc does not provide any
> stricmp() function unlike e.g. MSVC and probably because for some
> Unicode-supported characters the lowercase/uppercase has no sense.
> In fact, I see most times wxTolower() is implemented with a call to
> tolower() using an explicit cast from wxChar to char.
>
> Probably we should add a note in wxString docs saying that Case_Ignore
> flag has sense only for e.g. characters < 127. All other characters
> could be considered as "caseless" and thus always compared exactly even
> if Case_Ignore is given...
>
> Francesco
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-dev-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-dev-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20060802/a4cc8=
2b9/attachment.htm


More information about the wx-dev mailing list