HDF5 C++ API  1.10.1
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | List of all members
H5::StrType Class Reference

StrType is derived from a DataType and operates on HDF5 string datatype.

#include <H5StrType.h>

Inheritance diagram for H5::StrType:
H5::AtomType H5::DataType H5::H5Object H5::H5Location H5::IdComponent

Public Member Functions

 StrType (const PredType &pred_type)
 Creates a string datatype using a predefined type. More...
 
 StrType (const PredType &pred_type, const size_t &size)
 
 StrType (const int dummy, const size_t &size)
 Creates a string datatype with a specified length. More...
 
 StrType (const DataSet &dataset)
 Gets the string datatype of the specified dataset. More...
 
 StrType (const H5Location &loc, const char *name)
 Creates an StrType instance by opening an HDF5 string datatype given its name, provided as a C character string. More...
 
 StrType (const H5Location &loc, const H5std_string &name)
 Creates an StrType instance by opening an HDF5 string datatype given its name, provided as an H5std_string. More...
 
H5T_cset_t getCset () const
 Retrieves the character set type of this string datatype. More...
 
void setCset (H5T_cset_t cset) const
 Sets character set to be used. More...
 
H5T_str_t getStrpad () const
 Retrieves the storage mechanism for of this string datatype. More...
 
void setStrpad (H5T_str_t strpad) const
 Defines the storage mechanism for this string datatype. More...
 
virtual H5std_string fromClass () const
 Returns this class name. More...
 
 StrType ()
 Default constructor: Creates a stub string datatype. More...
 
 StrType (const hid_t existing_id)
 Creates an StrType object using the id of an existing datatype. More...
 
 StrType (const StrType &original)
 Copy constructor: makes a copy of the original StrType object. More...
 
virtual ~StrType ()
 Properly terminates access to this string datatype. More...
 
- Public Member Functions inherited from H5::AtomType
H5T_order_t getOrder () const
 Returns the byte order of an atomic datatype. More...
 
H5T_order_t getOrder (H5std_string &order_string) const
 This is an overloaded member function, provided for convenience. It takes a reference to a H5std_string for the buffer that provide the text description of the returned byte order. The text description can be either of the following: "Little endian byte ordering (0)"; "Big endian byte ordering (1)"; "VAX mixed byte ordering (2)";. More...
 
void setOrder (H5T_order_t order) const
 Sets the byte ordering of an atomic datatype. More...
 
int getOffset () const
 Retrieves the bit offset of the first significant bit. More...
 
void setOffset (size_t offset) const
 Sets the bit offset of the first significant bit. More...
 
void getPad (H5T_pad_t &lsb, H5T_pad_t &msb) const
 Retrieves the padding type of the least and most-significant bit padding. More...
 
void setPad (H5T_pad_t lsb, H5T_pad_t msb) const
 Sets the least and most-significant bits padding types. More...
 
size_t getPrecision () const
 Returns the precision of an atomic datatype. More...
 
void setPrecision (size_t precision) const
 Sets the precision of an atomic datatype. More...
 
void setSize (size_t size) const
 Sets the total size for an atomic datatype. More...
 
- Public Member Functions inherited from H5::DataType
 DataType (const H5T_class_t type_class, size_t size)
 Creates a object given its class and size. More...
 
 DataType (const DataType &original)
 Copy constructor: makes a copy of the original DataType object. More...
 
 DataType (const PredType &pred_type)
 Creates a DataType instance using a predefined type. More...
 
 DataType (const H5Location &loc, const void *ref, H5R_type_t ref_type=H5R_OBJECT, const PropList &plist=PropList::DEFAULT)
 Given a reference, ref, to an hdf5 group, creates a DataType object. More...
 
virtual void close ()
 Closes the datatype if it is not a predefined type. More...
 
void copy (const DataType &like_type)
 Copies an existing datatype to this datatype object. More...
 
void copy (const DataSet &dset)
 Copies the datatype of the given dataset to this datatype object. More...
 
H5T_class_t getClass () const
 Returns the datatype class identifier. More...
 
void commit (const H5Location &loc, const char *name)
 Commits a transient datatype to a file, creating a new named datatype. More...
 
void commit (const H5Location &loc, const H5std_string &name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in the type of the argument name. More...
 
bool committed () const
 Determines whether a datatype is a named type or a transient type. More...
 
H5T_conv_t find (const DataType &dest, H5T_cdata_t **pcdata) const
 Finds a conversion function that can handle a conversion from this datatype to the specified datatype, dest. More...
 
void convert (const DataType &dest, size_t nelmts, void *buf, void *background, const PropList &plist=PropList::DEFAULT) const
 Converts data from this datatype to the specified datatypes. More...
 
DataTypeoperator= (const DataType &rhs)
 Assignment operator. More...
 
bool operator== (const DataType &compared_type) const
 Compares this DataType against the given one to determines whether the two objects refer to the same actual datatype. More...
 
void lock () const
 Locks a datatype, making it read-only and non-destructible. More...
 
size_t getSize () const
 Returns the size of a datatype. More...
 
DataType getSuper () const
 Returns the base datatype from which a datatype is derived. More...
 
void registerFunc (H5T_pers_t pers, const char *name, const DataType &dest, H5T_conv_t func) const
 Registers the specified conversion function. More...
 
void registerFunc (H5T_pers_t pers, const H5std_string &name, const DataType &dest, H5T_conv_t func) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in the type of the argument name. More...
 
void unregister (H5T_pers_t pers, const char *name, const DataType &dest, H5T_conv_t func) const
 Removes a conversion function from all conversion paths. More...
 
void unregister (H5T_pers_t pers, const H5std_string &name, const DataType &dest, H5T_conv_t func) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in the type of the argument name. More...
 
void setTag (const char *tag) const
 Tags an opaque datatype. More...
 
void setTag (const H5std_string &tag) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in the type of the argument name. More...
 
H5std_string getTag () const
 Gets the tag associated with an opaque datatype. More...
 
bool detectClass (H5T_class_t cls) const
 Checks whether a datatype contains (or is) a certain type of datatype. More...
 
bool isVariableStr () const
 Check whether this datatype is a variable-length string. More...
 
PropList getCreatePlist () const
 Returns a copy of the property list, which is for datatype creation. More...
 
 DataType (const H5Location &loc, const char *name)
 Creates a DataType instance by opening an HDF5 datatype given its name as a char*. More...
 
 DataType (const H5Location &loc, const H5std_string &name)
 Creates a DataType instance by opening an HDF5 datatype given its name as an H5std_string. More...
 
 DataType (const hid_t type_id)
 Creates a datatype using an existing datatype's id. More...
 
 DataType ()
 Default constructor: Creates a stub datatype. More...
 
virtual hid_t getId () const
 Get the id of this datatype. More...
 
virtual ~DataType ()
 Properly terminates access to this datatype. More...
 
- Public Member Functions inherited from H5::H5Object
Attribute createAttribute (const char *name, const DataType &type, const DataSpace &space, const PropList &create_plist=PropList::DEFAULT) const
 Creates an attribute for a group, dataset, or named datatype. More...
 
Attribute createAttribute (const H5std_string &name, const DataType &type, const DataSpace &space, const PropList &create_plist=PropList::DEFAULT) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an H5std_string for name. More...
 
Attribute openAttribute (const char *name) const
 Opens an attribute given its name. More...
 
Attribute openAttribute (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an H5std_string for name. More...
 
Attribute openAttribute (const unsigned int idx) const
 Opens an attribute given its index. More...
 
int iterateAttrs (attr_operator_t user_op, unsigned *idx=NULL, void *op_data=NULL)
 Iterates a user's function over all the attributes of an H5 object, which may be a group, dataset or named datatype. More...
 
unsigned objVersion () const
 Returns the header version of this HDF5 object. More...
 
bool attrExists (const char *name) const
 Checks whether the named attribute exists at this location. More...
 
bool attrExists (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an H5std_string for name. More...
 
void renameAttr (const char *oldname, const char *newname) const
 Renames the named attribute from this object. More...
 
void renameAttr (const H5std_string &oldname, const H5std_string &newname) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an H5std_string for the names. More...
 
void removeAttr (const char *name) const
 Removes the named attribute from this object. More...
 
void removeAttr (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes a reference to an H5std_string for name. More...
 
- Public Member Functions inherited from H5::H5Location
bool exists (const char *name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Checks if a link of a given name exists in a location. More...
 
bool exists (const H5std_string &name, const LinkAccPropList &lapl=LinkAccPropList::DEFAULT) const
 Checks if a link of a given name exists in a location. More...
 
void flush (H5F_scope_t scope) const
 Flushes all buffers associated with a location to disk. More...
 
H5std_string getFileName () const
 Gets the name of the file, in which this HDF5 object belongs. More...
 
H5G_obj_t getObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
 Retrieves the type of object that an object reference points to. More...
 
H5O_type_t getRefObjType (void *ref, H5R_type_t ref_type=H5R_OBJECT) const
 Retrieves the type of object that an object reference points to. More...
 
void setComment (const char *name, const char *comment) const
 Sets or resets the comment for an object specified by its name. More...
 
void setComment (const H5std_string &name, const H5std_string &comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name and comment. More...
 
void setComment (const char *comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it doesn't take an object name. More...
 
void setComment (const H5std_string &comment) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for comment. More...
 
ssize_t getComment (const char *name, size_t buf_size, char *comment) const
 Retrieves the comment for this location, returning its length. More...
 
H5std_string getComment (const char *name, size_t buf_size=0) const
 Returns the comment as string for this location, returning its length. More...
 
H5std_string getComment (const H5std_string &name, size_t buf_size=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void removeComment (const char *name) const
 Removes the comment from an object specified by its name. More...
 
void removeComment (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void reference (void *ref, const char *name, H5R_type_t ref_type=H5R_OBJECT) const
 This is an overloaded function, provided for your convenience. It differs from the above function in that it does not take a DataSpace object and the reference type must be specified. More...
 
void reference (void *ref, const H5std_string &name, H5R_type_t ref_type=H5R_OBJECT) const
 This is an overloaded function, provided for your convenience. It differs from the above function in that it takes an H5std_string for the object's name. More...
 
void reference (void *ref, const char *name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
 Creates a reference to an HDF5 object or a dataset region. More...
 
void reference (void *ref, const H5std_string &name, const DataSpace &dataspace, H5R_type_t ref_type=H5R_DATASET_REGION) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void dereference (const H5Location &loc, const void *ref, H5R_type_t ref_type=H5R_OBJECT, const PropList &plist=PropList::DEFAULT)
 Dereferences a reference into an HDF5 object, given an HDF5 object. More...
 
DataSpace getRegion (void *ref, H5R_type_t ref_type=H5R_DATASET_REGION) const
 Retrieves a dataspace with the region pointed to selected. More...
 
Group createGroup (const char *name, size_t size_hint=0) const
 Creates a new group at this location which can be a file or another group. More...
 
Group createGroup (const H5std_string &name, size_t size_hint=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
Group openGroup (const char *name) const
 Opens an existing group in a location which can be a file or another group. More...
 
Group openGroup (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
DataSet createDataSet (const char *name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT) const
 Creates a new dataset at this location. More...
 
DataSet createDataSet (const H5std_string &name, const DataType &data_type, const DataSpace &data_space, const DSetCreatPropList &create_plist=DSetCreatPropList::DEFAULT) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
DataSet openDataSet (const char *name) const
 Opens an existing dataset at this location. More...
 
DataSet openDataSet (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
H5std_string getLinkval (const char *link_name, size_t size=0) const
 Returns the name of the object that the symbolic link points to. More...
 
H5std_string getLinkval (const H5std_string &link_name, size_t size=0) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
int getNumAttrs () const
 Returns the number of attributes attached to this HDF5 object. More...
 
H5std_string getObjnameByIdx (hsize_t idx) const
 Returns the name of an object in this group, given the object's index. More...
 
ssize_t getObjnameByIdx (hsize_t idx, char *name, size_t size) const
 Retrieves the name of an object in this group, given the object's index. More...
 
ssize_t getObjnameByIdx (hsize_t idx, H5std_string &name, size_t size) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
H5O_type_t childObjType (const H5std_string &objname) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name. More...
 
H5O_type_t childObjType (const char *objname) const
 Returns the type of an object in this file/group, given the object's name. More...
 
H5O_type_t childObjType (hsize_t index, H5_index_t index_type=H5_INDEX_NAME, H5_iter_order_t order=H5_ITER_INC, const char *objname=".") const
 Returns the type of an object in this file/group, given the object's index and its type and order. More...
 
unsigned childObjVersion (const char *objname) const
 Returns the object header version of an object in this file/group, given the object's name. More...
 
unsigned childObjVersion (const H5std_string &objname) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for the object's name. More...
 
H5G_obj_t getObjTypeByIdx (hsize_t idx) const
 Returns the type of an object in this group, given the object's index. More...
 
H5G_obj_t getObjTypeByIdx (hsize_t idx, char *type_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (char*) More...
 
H5G_obj_t getObjTypeByIdx (hsize_t idx, H5std_string &type_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function because it also provides the returned object type in text (H5std_string&) More...
 
void getObjinfo (const char *name, hbool_t follow_link, H5G_stat_t &statbuf) const
 Returns information about an object. More...
 
void getObjinfo (const H5std_string &name, hbool_t follow_link, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void getObjinfo (const char *name, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above functions in that it doesn't have the paramemter follow_link. More...
 
void getObjinfo (const H5std_string &name, H5G_stat_t &statbuf) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
int iterateElems (const char *name, int *idx, H5G_iterate_t op, void *op_data)
 Iterates a user's function over the entries of a group. More...
 
int iterateElems (const H5std_string &name, int *idx, H5G_iterate_t op, void *op_data)
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void link (H5L_type_t link_type, const char *curr_name, const char *new_name) const
 Creates a link of the specified type from new_name to curr_name. More...
 
void link (H5L_type_t link_type, const H5std_string &curr_name, const H5std_string &new_name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for curr_name and new_name. More...
 
void unlink (const char *name) const
 Removes the specified name at this location. More...
 
void unlink (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void mount (const char *name, const H5File &child, const PropList &plist) const
 Mounts the file child onto this group. More...
 
void mount (const H5std_string &name, const H5File &child, const PropList &plist) const
 This is an overloaded member function, provided for convenience. It takes an H5std_string for name. More...
 
void unmount (const char *name) const
 Unmounts the specified file. More...
 
void unmount (const H5std_string &name) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for name. More...
 
void move (const char *src, const char *dst) const
 Renames an object at this location. More...
 
void move (const H5std_string &src, const H5std_string &dst) const
 This is an overloaded member function, provided for convenience. It differs from the above function in that it takes an H5std_string for src and dst. More...
 
virtual void throwException (const H5std_string &func_name, const H5std_string &msg) const
 For subclasses, H5File and Group, to throw appropriate exception. More...
 
 H5Location ()
 
- Public Member Functions inherited from H5::IdComponent
void incRefCount (const hid_t obj_id) const
 Increment reference counter for a given id. More...
 
void incRefCount () const
 Increment reference counter for the id of this object. More...
 
void decRefCount (const hid_t obj_id) const
 Decrement reference counter for a given id. More...
 
void decRefCount () const
 Decrement reference counter for the id of this object. More...
 
int getCounter (const hid_t obj_id) const
 Returns the reference counter for a given id. More...
 
int getCounter () const
 Returns the reference counter for the id of this object. More...
 
H5I_type_t getHDFObjType () const
 Returns the type of the object. It is an overloaded function of the above function. More...
 
IdComponentoperator= (const IdComponent &rhs)
 Assignment operator. More...
 
void setId (const hid_t new_id)
 Sets the identifier of this object to a new value. More...
 
virtual ~IdComponent ()
 Noop destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from H5::IdComponent
static H5I_type_t getHDFObjType (const hid_t obj_id)
 Given an id, returns the type of the object. More...
 
static hsize_t getNumMembers (H5I_type_t type)
 Returns the number of members of the given type. More...
 
static bool isValid (hid_t an_id)
 Checks if the given ID is valid. More...
 
static bool typeExists (H5I_type_t type)
 Queries if a given type is currently registered with the library. More...
 
- Protected Member Functions inherited from H5::H5Location
virtual ~H5Location ()
 

Constructor & Destructor Documentation

H5::StrType::StrType ( const PredType pred_type)
Parameters
pred_type- IN: Predefined datatype
Exceptions
H5::DataTypeIException

References H5::DataType::copy().

H5::StrType::StrType ( const PredType pred_type,
const size_t &  size 
)
H5::StrType::StrType ( const int  dummy,
const size_t &  size 
)
Parameters
dummy- IN: To simplify calling the previous constructor and avoid prototype clash with another constructor
size- IN: Length of the new string type
Exceptions
H5::DataTypeIException
Description
The 1st argument is just a dummy to simplify calling the previous constructor, such as: StrType atype(0, size) instead of StrType atype(PredType::C_S1, size)

References H5::PredType::C_S1, H5::DataType::copy(), and H5::AtomType::setSize().

H5::StrType::StrType ( const DataSet dataset)
Parameters
dataset- IN: Dataset that this string datatype associates with
Exceptions
H5::DataTypeIException

References H5::DataSet::getId().

H5::StrType::StrType ( const H5Location loc,
const char *  dtype_name 
)
Parameters
loc- IN: Location of the type
dtype_name- IN: String type name
Exceptions
H5::DataTypeIException
H5::StrType::StrType ( const H5Location loc,
const H5std_string &  dtype_name 
)
Parameters
loc- IN: Location of the type
dtype_name- IN: String type name
Exceptions
H5::DataTypeIException
H5::StrType::StrType ( )
H5::StrType::StrType ( const hid_t  existing_id)
Parameters
existing_id- IN: Id of an existing datatype
Exceptions
H5::DataTypeIException
H5::StrType::StrType ( const StrType original)
H5::StrType::~StrType ( )
virtual

Member Function Documentation

virtual H5std_string H5::StrType::fromClass ( ) const
inlinevirtual

Reimplemented from H5::AtomType.

H5T_cset_t H5::StrType::getCset ( ) const
Returns
Character set type, which can be:
  • H5T_CSET_ASCII (0) - Character set is US ASCII.
Note
ASCII and UTF-8 Unicode are the only currently supported character encodings. Extended ASCII encodings (for example, ISO 8859) are not supported. This encoding policy is not enforced by the HDF5 Library. Using encodings other than ASCII and UTF-8 can lead to compatibility and usability problems. See the C API entry H5Pset_char_encoding for more information.
Exceptions
H5::DataTypeIException
H5T_str_t H5::StrType::getStrpad ( ) const
Returns
String storage mechanism, which can be:
  • H5T_STR_NULLTERM (0) - Null terminate (as C does)
  • H5T_STR_NULLPAD (0) - Pad with zeros
  • H5T_STR_SPACEPAD (0) - pad with spaces (as FORTRAN does)
Exceptions
H5::DataTypeIException
void H5::StrType::setCset ( H5T_cset_t  cset) const
Parameters
cset- IN: character set type, which can be:
  • H5T_CSET_ASCII (0) - Character set is US ASCII.
Note
ASCII and UTF-8 Unicode are the only currently supported character encodings. Extended ASCII encodings (for example, ISO 8859) are not supported. This encoding policy is not enforced by the HDF5 Library. Using encodings other than ASCII and UTF-8 can lead to compatibility and usability problems. See the C API entry H5Pset_char_encoding for more information.
Exceptions
H5::DataTypeIException
void H5::StrType::setStrpad ( H5T_str_t  strpad) const
Parameters
strpad- IN: String padding type
Exceptions
H5::DataTypeIException
Description
For detail, please refer to the C layer Reference Manual at: http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad

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


The HDF Group Help Desk:
  Copyright by The HDF Group
and the Board of Trustees of the University of Illinois