lmi
[Top][All Lists]
Advanced

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

Re: [lmi] change file formats to XML


From: Greg Chicares
Subject: Re: [lmi] change file formats to XML
Date: Thu, 11 Mar 2010 18:26:13 +0000
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

On 2010-03-09 17:53Z, Vaclav Slavik wrote:
[...]
> Turns out that this behavior of set_content() is intentional. I'll add a
> replacement in xmlwrapp 0.7 [...]

Since we're talking about a new version of xmlwrapp...given that this
already exists:

  void xml::document::save_to_string(std::string&)
    Convert the XML document tree into XML text data
    and place it into the given string.

would it make sense to add a companion function as follows (e.g.)?

  void xml::document::parse_from_string(std::string const&)
    Parse the string into an XML document tree.
    Inverse of xml::document::save_to_string().

Here's my use case. I'm writing a unit test that measures the speed of
various xml serialization techniques. Just to take one example, I want
to validate that this code from your serialization patch is indeed more
efficient:

    // specialization for std::string is both more efficient and required for
    // correct reading of strings with whitespace in them
    template<>
    struct type_io<std::string>

Writing to a file adds overhead that introduces noise into the speed
measurements I'm making. I could remove (most of) that overhead if I
could use a string instead of a file for document I/O.

Of course, that's not a crucial problem--I can write enough elements
to overwhelm the noise--but this might be nice to have someday.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]