[Top][All Lists]

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

Re: [h5md-user] Mandate Variable-length string datatype

From: Felix Höfling
Subject: Re: [h5md-user] Mandate Variable-length string datatype
Date: Mon, 23 Sep 2013 10:43:39 +0200
User-agent: Opera Mail/12.15 (Linux)

Am 19.09.2013, 06:28 Uhr, schrieb Peter Colberg


This minor proposal sort of builds on Olaf’s major proposal [1] to
explicitely specify HDF5 datatypes, or classes of datatypes.

[1] http://thread.gmane.org/gmane.science.simulation.h5md.user/262

I would like to mandate the variable-length string datatype for all
string values appearing in the specification. The restriction to
variable-length strings simplifies the implementation of H5MD readers
in low-level programs greatly, as fixed-length and variable-length
string datatypes are not convertible.

I'm not in favour of restricting the string types and also not of
variable-length strings.

I don't see any benefit for the file format in such a restriction.

From a C++ perspective which hides memory allocation in std::string for
instance, reading a fixed string is much easier. Otherwise, one has to
read a C-string first and to copy to std::string second. (I definitely
don't want to return a plain C-string in C++) For low-level languages the
converse is true. Eventually, reading a string will go to a single
function inside the reader program and there it is not too much pain to
implement both types of strings IMO.

Concerning string arrays, I'm not sure whether it is possible to store
vlen strings. Probably it is, but only with a nested file layout which
appears inefficient.


reply via email to

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