From cb894f2e605f021afa5d0239bff15b611c198b23 Mon Sep 17 00:00:00 2001 From: Eugen Wintersberger Date: Sun, 8 Sep 2019 14:58:22 +0200 Subject: [PATCH] Added the default constructor to the fixed length ASCII string class Update #414 --- src/h5cpp/stl/string_types.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/h5cpp/stl/string_types.hpp b/src/h5cpp/stl/string_types.hpp index 532c5c2038..1d7c8d67e9 100644 --- a/src/h5cpp/stl/string_types.hpp +++ b/src/h5cpp/stl/string_types.hpp @@ -49,6 +49,7 @@ class FixedASCIIString : public std::string { public: using std::string::string; + FixedASCIIString() : std::string() {} FixedASCIIString(const std::string &string) : std::string(string) {} FixedASCIIString(std::string &&string) : std::string(std::move(string)) {} }; @@ -94,6 +95,14 @@ class Trait using Type = type::FixedUTF8String; using TypeClass = datatype::String; + /** + * @brief construct an HDF5 datatype from a string instance + * + * For a string of fixed length an instance of an original string is + * required. + * + * @param value the actual string instance for which to construct the type + */ static datatype::String create(const Type &value) { datatype::String type = String::fixed(value.size());