[Development] QRegularExpression -- first round of API review
andre at familiesomers.nl
Fri Dec 16 08:01:37 CET 2011
Op 16-12-2011 1:07, Giuseppe D'Angelo schreef:
>> fwiw, the usual elegant solution is having a value and a mask parameter.
>> the mask could have two magic values meaning "un-/set all asserted in
>> vlaue" to mean effectively what your bool means. the default argument
>> would be the magic value for setting, so the standard syntax would set
>> all flags named in the first argument.
> I'm not sure I understand this point completely -- isn't that what the
> method does? I.e.
> rx.setPatternOptions(CaseInsensitiveOption | DotMatchesEverythingOption)
> turns on those two options, and leaves the others unchanged.
Really? Now to me _that_ is unexpected behaviour. I would have expected
that this method call would set the options to exactly
(CaseInsensitiveOption | DotMatchesEverythingOption), no matter what the
previous value of the matchingOptions value was.
More information about the Development