RTL_CONSTASCII_(U)STRINGPARAM officially obsolete
caolanm at redhat.com
Thu Apr 5 05:47:24 PDT 2012
On Thu, 2012-04-05 at 14:39 +0200, Lubos Lunak wrote:
> On Thursday 05 of April 2012, Caolán McNamara wrote:
> > On Thu, 2012-04-05 at 08:43 +0300, Tor Lillqvist wrote:
> > > > if (foo.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("XXXXX")))
> > > > if (foo.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XXXXX"))))
> > > >
> > > > can be written as
> > > >
> > > > if( foo == "XXXXX" )
> > >
> > > This has to be the biggest improvement in OOo/LO codebase readability
> > > ever! Incredibly nice!
> > Look good. I wonder though if its only me that would prefer not to have
> > an overloaded operator== and to force bar.equalsfoo("").
> Quite possibly yes :). Why would you want the explicit less convenient way?
Cause I worry that someone's going to end up comparing string literals
to each other under some conversion like
-#define FOO rtl::OUString(..."foo"...)
+#define FOO "foo"
-#define BAR rtl::OUString(..."bar"...)
+#define BAR "bar"
if (FOO == BAR)
More information about the LibreOffice