Will, My first wild idea is that if you do it all properly, go for it. Like to be sure that we don't require user to free anything she did not allocate and that we don't return reference to a temporary from a function, try it.
Now, concerning the binding, we don't have big issues with binding libwpd's WPXString in the libwpd2-bindings module and also the len() function that is returning the unicode character count is great. So, if it is not really a huge performance problem I would plead to stick with WPXString for 0.9.x and try to simplify the API after. The reason is that I actually settled for using the WPXString everywhere in libraries that have something to do with libwpd and would not be very confortable to do such a huge change at this point of the release cycle. Cheers Fridrich On Sat, 2010-10-23 at 11:45 -0400, William Lachance wrote: > Hey, > > So after having come back to libwpd after a few years, I realized that > I made one mistake when designing the external API. > > For various reasons (OOo compatibility, language bindings) we don't > want to export STL structures (string, map, etc.) in the external API. > For this reason, I created a class called WPXString to wrap > std::string. I've since come to realize that this isn't really > necessary. For libwpd's external API, we can just use const char *, > which binds quite nicely and has no overhead. For its internal API, we > can just use std::string straight up. > > Benefits: > > 1. Library becomes easier to understand (no need to look up > WPXString's various methods), both internally and externally > 2. Library becomes easier to bind. > 2. Somewhat reduced overhead. > > Thoughts? ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Libwpd-devel mailing list Libwpd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libwpd-devel