HDFql Reference Manual v2.6.0

6.1.11CHAR

The HDFql CHAR data type stores values between 0 and 255 and occupies size * 1 byte in memory (where size is the length of the string). It represents the data type of an HDF5 H5T_C_S1 dataset/attribute or of a result set that stores elements of this type (which can be retrieved using the HDFQL_CURSOR_GET_UNSIGNED_TINYINT and HDFQL_SUBCURSOR_GET_UNSIGNED_TINYINT functions when working with cursors). The CHAR data type is useful for storing fixed-length strings. Depending on the programming language supported by HDFql, the CHAR data type is represented by:

  • In C, the “unsigned char [size]” data type.
  • In C++, the “unsigned char [size]” data type.
  • In Java, the “byte [size]” data type (or corresponding wrapper class “Byte [size]”).
  • In Python, the “Ssize” NumPy data type.
  • In C#, the “Byte [size]” data type (or corresponding alias “byte [size]”).
  • In Fortran, the “CHARACTER(LEN = size)” data type.
  • In R16, the “integer” data type.
  • In MATLAB, the “uint8” data type.

Notes

  1. By design, R does not provide a data type that stores values between 0 and 255 using exactly 1 byte of memory. As a substitute, the R “integer” data type may be used, at the cost of increased memory usage (as it occupies 4 bytes of memory) and lower performance (as byte alignment must be performed by HDFql) ↩