[poppler] GooString — Why do we use it instead of std::string?

Albert Astals Cid aacid at kde.org
Mon Nov 7 06:44:23 PST 2011


A Dimarts, 8 de novembre de 2011, Alec Taylor vàreu escriure:
> But the libraries used are obsolete/redundant!

obsolete:
   1. No longer produced or used; out of date.

redundant:
   1. No longer needed or useful; superfluous.
   2. Able to be omitted without loss of meaning or function.

I would not say GooString is obsolete, since we do maitain and use it. I guess 
you are trying to argue it is redundant by the 2nd definition, but i do not 
see a sanitizedName or hasUnicodeMarker or even a formatv method replacement 
in std::string. Of course you could reimplement those features on top of 
std::string but that is work for nothing, that in my book is never a good 
idea.

GBool is already a bool ;-)

So as said, if you have a need for std::string use it, but do not try to give 
bulk patches because they won't be accepted.

Albert

> 
> On Tue, Nov 8, 2011 at 1:11 AM, Albert Astals Cid <aacid at kde.org> wrote:
> > A Dimarts, 8 de novembre de 2011, vàreu escriure:
> >> If I wrote a PATCH to replace all GooString and GBool usages in
> >> pdftohtml wtih bool and std::string, would it be approved?
> > 
> > No. Changing perfectly working code for no reason is not a good idea.
> > 
> > Albert
> > 
> >> On Mon, Nov 7, 2011 at 10:25 PM, Albert Astals Cid <aacid at kde.org> wrote:
> >> > A Dissabte, 5 de novembre de 2011, Alec Taylor vàreu escriure:
> >> >> As you say, that only used to be a problem in stdlib, it is no
> >> >> longer
> >> >> a
> >> >> problem.
> >> >> 
> >> >> There are various features of std::string not present in
> >> >> GooString,
> >> >> which I need for my patches to poppler.
> >> > 
> >> > As i said, if it is for use in pdftohtml, go for it, use
> >> > std::string.
> >> > 
> >> > Albert
> >> > 
> >> >> Most obviously, it is missing a substr() member.
> >> >> 
> >> >> Are there any restrictions/problems with the current std::string
> >> >> when
> >> >> compared with GooString?
> >> >> 
> >> >> > As far as presence of GooString in public API is concerned,
> >> >> > I
> >> >> > guess it
> >> >> > comes from the fact (or FUD otherwise) that putting template
> >> >> > C++
> >> >> > classes in public API is considered ABI-unsafe (easier to
> >> >> > break).
> >> >> > And
> >> >> > while there aren't any issues with STL in this regard
> >> >> > recently,
> >> >> > Boost
> >> >> > for instance would be a different story.
> >> >> > So GooString would be safe alternative.
> >> >> > 
> >> >> > regards
> >> >> > MM
> >> >> 
> >> >> _______________________________________________
> >> >> poppler mailing list
> >> >> poppler at lists.freedesktop.org
> >> >> http://lists.freedesktop.org/mailman/listinfo/poppler
> >> > 
> >> > _______________________________________________
> >> > poppler mailing list
> >> > poppler at lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/poppler
> > 
> > _______________________________________________
> > poppler mailing list
> > poppler at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/poppler
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler


More information about the poppler mailing list