[Development] QRegularExpression -- first round of API review

Thiago Macieira thiago.macieira at intel.com
Fri Dec 16 01:10:42 CET 2011


On Thursday, 15 de December de 2011 22.53.19, joao.abecasis at nokia.com wrote:
> Hi Giuseppe,
> 
> I'll start by saying tl;dr. But I didn't stop because of your e-mail, I'm
> actually referring to the API.

Hi as well Giuseppe

I did read most of your email :-) Thanks for the effort so far.

I'd like to start by saying I agree with Ossi: the test/set way of setting 
flags is "un-Qt-ish". I know it exists in a few places, but they are the vast 
minority. I'd prefer a regular pair of getter and setter on the QFlags type.

> I started looking at it and it seems too cluttered. Specially this early in
> the process. It's hard to review something that is trying to be everything
> or maybe it's just exposing too many things.

João is also right: it seems you're trying to provide all the power of PCRE to 
the user in the first go. It's  good that you're exploring everything, so we 
know which way we may go in the future, but I think we can trim down on the 
features at the first iteration of the API.

The next thing that I find weird is the set of match functions. My first 
reaction was to ask you to call them "indexIn", but since they don't return an 
index but a match object, the name is fine. But still, do we need a match, 
partialMatch and exactMatch? Also note that the boolean in partialMatch is 
also "un-Qt-ish", so you'll need to replace it with an enum as well. If you 
do, you may as well merge all three functions.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20111216/35e9d7cf/attachment.sig>


More information about the Development mailing list