Skip to content

Commit

Permalink
Added the default constructor to the fixed length ASCII string class
Browse files Browse the repository at this point in the history
Update #414
  • Loading branch information
eugenwintersberger committed Sep 8, 2019
1 parent c2709bb commit cb894f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/h5cpp/stl/string_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {}
};
Expand Down Expand Up @@ -94,6 +95,14 @@ class Trait<type::FixedUTF8String>
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());
Expand Down

0 comments on commit cb894f2

Please sign in to comment.