HighFive 2.9.0
HighFive - Header-only C++ HDF5 interface
Loading...
Searching...
No Matches
HighFive::FixedLengthStringType Class Reference

#include <H5DataType.hpp>

Inheritance diagram for HighFive::FixedLengthStringType:
Collaboration diagram for HighFive::FixedLengthStringType:

Public Member Functions

 FixedLengthStringType (size_t size, StringPadding padding, CharacterSet character_set=CharacterSet::Ascii)
 Create a fixed length string datatype.
 
- Public Member Functions inherited from HighFive::StringType
CharacterSet getCharacterSet () const
 For stings return the character set.
 
StringPadding getPadding () const
 For fixed length stings return the padding.
 
- Public Member Functions inherited from HighFive::DataType
bool operator== (const DataType &other) const
 
bool operator!= (const DataType &other) const
 
DataTypeClass getClass () const
 Return the fundamental type.
 
size_t getSize () const
 Returns the length (in bytes) of this type elements.
 
std::string string () const
 Returns a friendly description of the type (e.g. Float32)
 
bool isVariableStr () const
 Returns whether the type is a variable-length string.
 
bool isFixedLenStr () const
 Returns whether the type is a fixed-length string.
 
StringType asStringType () const
 Returns this datatype as a StringType.
 
bool empty () const noexcept
 Check the DataType was default constructed.
 
bool isReference () const
 Returns whether the type is a Reference.
 
DataTypeCreateProps getCreatePropertyList () const
 Get the list of properties for creation of this DataType.
 
- Public Member Functions inherited from HighFive::Object
 Object (Object &&other) noexcept
 
 ~Object ()
 
bool isValid () const noexcept
 isValid
 
hid_t getId () const noexcept
 getId
 
ObjectInfo getInfo () const
 Retrieve several infos about the current object (address, dates, etc)
 
ObjectType getType () const
 Gets the fundamental type of the object (dataset, group, etc)
 
bool operator== (const Object &other) const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from HighFive::DataType
 Object (Object &&other) noexcept
 
 Object ()
 
 Object (const Object &other)
 
 Object (hid_t)
 
- Protected Member Functions inherited from HighFive::Object
 Object ()
 
 Object (const Object &other)
 
 Object (hid_t)
 
Objectoperator= (const Object &other)
 
- Protected Attributes inherited from HighFive::Object
hid_t _hid
 

Constructor & Destructor Documentation

◆ FixedLengthStringType()

HighFive::FixedLengthStringType::FixedLengthStringType ( size_t size,
StringPadding padding,
CharacterSet character_set = CharacterSet::Ascii )
inline

Create a fixed length string datatype.

The string will be size bytes long, regardless whether it's ASCII or UTF8. In particular, a string with n UFT8 characters in general requires 4*n bytes.

The string padding is subtle, essentially it's just a hint. A null-terminated string is guaranteed to have one ‘’\0'which marks the semantic end of the string. The length of the buffer must be at least sizebytes regardless. HDF5 will read or writesizebytes, irrespective of the when the\0` occurs.

Note that when writing passing StringPadding::NullTerminated is a guarantee to the reader that it contains a \0. Therefore, make sure that the string really is nullterminated. Otherwise prefer a null-padded string which only means states that the buffer is filled up with 0 or more \0.


The documentation for this class was generated from the following files: