[gdome]Further notes about gmetadom string conversions



Hello,

A couple other things I would have liked to be somehow documented:

 - You must free the result of a DOMString::to<whatever> function
 - What is the unsigned parameter to DOMString::toU* functions and what
   its use is (since UTF8 strings can be null-terminated, I would not
   expect a need to pass a by-reference `length' parameter to toUTF8(),
   given that toC() does not require it).

Then, to encourage the use of DOMStrings instead of std::string, at
least a comparison operator would be handy, since it would allow to use
DOMStrings with std::set, std::map and other sorted containers.
IMHO however, forcing people using gmetadom to replace std::string with
DOMString is bad.

Last, since all the to* functions need the invoker to deallocate the
result, something to directly convert DOMStrings to std::strings, that,
contrary to C strings, do memory management properly, is strongly wanted.


Bye, Enrico

--
GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <enrico debian org>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]