[gmx-developers] XML and std::map?

David van der Spoel spoel at xray.bmc.uu.se
Wed Sep 23 10:23:30 CEST 2015


On 22/09/15 20:24, Vedran Miletić wrote:
> 2015-09-22 12:32 GMT+02:00 David van der Spoel <spoel at xray.bmc.uu.se>:
>> On 22/09/15 11:47, Vedran Miletić wrote:
>>>
>>>
>>> Hello David,
>>>
>>> would the approach you have in mind imply some kind of nested
>>> std::map<std::string, std::map<...> > type?
>>
>>
>> I guess something like that. Any suggestions or experience?
>>
>
> Haven't really tried it. My main concern is that you can't predict the
> std::map<...> that will come out of readXml(), unless you know the
> number of levels of nesting in advance. So it is a bit inflexible.
>
I guess the routine parsing the std::map has to interpret what is there, 
right? And as such this routine has to have the information that is 
needed. The idea would be just to have a generic tree structure to 
parse, and to have just one routine deal with libxml2 rather than 
directly interfacing to libxml2 from every file that has to be read.

The question is therefore mainly whether std::map is the right structure?

> Regards,
> Vedran
>


-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
spoel at xray.bmc.uu.se    http://folding.bmc.uu.se


More information about the gromacs.org_gmx-developers mailing list