summaryrefslogtreecommitdiffstats
path: root/c++/src/H5StrType.cpp
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-09-30 14:27:10 (GMT)
commitb2d661b508a7fc7a2592c13bc6bdc175551f075d (patch)
tree13baeb0d83a7c2a4c6299993c182b1227c2f6114 /c++/src/H5StrType.cpp
parent29ab58b58dce556639ea3154e262895773a8a8df (diff)
downloadhdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz
hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2
Clang-format of source files
Diffstat (limited to 'c++/src/H5StrType.cpp')
-rw-r--r--c++/src/H5StrType.cpp57
1 files changed, 28 insertions, 29 deletions
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index f5b65e4..c246933 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -49,7 +49,7 @@ StrType::StrType() : AtomType() {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const PredType& pred_type) : AtomType()
+StrType::StrType(const PredType &pred_type) : AtomType()
{
// use DataType::copy to make a copy of this predefined type
copy(pred_type);
@@ -78,7 +78,7 @@ StrType::StrType(const PredType& pred_type) : AtomType()
// Planned for removal. -BMR, 2005/12/02
// Removed from documentation. -BMR, 2016/03/07
//--------------------------------------------------------------------------
-StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType()
+StrType::StrType(const PredType &pred_type, const size_t &size) : AtomType()
{
// use DataType::copy to make a copy of the string predefined type
// then set its length
@@ -102,7 +102,7 @@ StrType::StrType(const PredType& pred_type, const size_t& size) : AtomType()
// This constructor replaced the previous one.
// Programmer Binh-Minh Ribler - Nov 28, 2005
//--------------------------------------------------------------------------
-StrType::StrType(const int dummy, const size_t& size) : AtomType()
+StrType::StrType(const int dummy, const size_t &size) : AtomType()
{
// use DataType::copy to make a copy of the string predefined type
// then set its length
@@ -117,14 +117,14 @@ StrType::StrType(const int dummy, const size_t& size) : AtomType()
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const hid_t existing_id) : AtomType( existing_id ) {}
+StrType::StrType(const hid_t existing_id) : AtomType(existing_id) {}
//--------------------------------------------------------------------------
// Function: StrType copy constructor
///\brief Copy constructor: same HDF5 object as \a original
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const StrType& original) : AtomType ( original ) {}
+StrType::StrType(const StrType &original) : AtomType(original) {}
//--------------------------------------------------------------------------
// Function: StrType overloaded constructor
@@ -133,13 +133,12 @@ StrType::StrType(const StrType& original) : AtomType ( original ) {}
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-StrType::StrType(const DataSet& dataset) : AtomType ()
+StrType::StrType(const DataSet &dataset) : AtomType()
{
// Calls C function H5Dget_type to get the id of the datatype
id = H5Dget_type(dataset.getId());
- if (id < 0)
- {
+ if (id < 0) {
throw DataSetIException("StrType constructor", "H5Dget_type failed");
}
}
@@ -158,7 +157,7 @@ StrType::StrType(const DataSet& dataset) : AtomType ()
// improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
-StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType()
+StrType::StrType(const H5Location &loc, const char *dtype_name) : AtomType()
{
id = p_opentype(loc, dtype_name);
}
@@ -177,7 +176,7 @@ StrType::StrType(const H5Location& loc, const char *dtype_name) : AtomType()
// to improve usability.
// -BMR, Dec 2016
//--------------------------------------------------------------------------
-StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomType()
+StrType::StrType(const H5Location &loc, const H5std_string &dtype_name) : AtomType()
{
id = p_opentype(loc, dtype_name.c_str());
}
@@ -190,7 +189,8 @@ StrType::StrType(const H5Location& loc, const H5std_string& dtype_name) : AtomTy
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - Aug 2017
//--------------------------------------------------------------------------
-DataType* StrType::decode() const
+DataType *
+StrType::decode() const
{
hid_t encoded_strtype_id = H5I_INVALID_HID;
try {
@@ -201,7 +201,7 @@ DataType* StrType::decode() const
}
StrType *encoded_strtype = new StrType;
encoded_strtype->p_setId(encoded_strtype_id);
- return(encoded_strtype);
+ return (encoded_strtype);
}
//--------------------------------------------------------------------------
@@ -219,16 +219,16 @@ DataType* StrType::decode() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_cset_t StrType::getCset() const
+H5T_cset_t
+StrType::getCset() const
{
H5T_cset_t cset = H5Tget_cset(id);
// Returns a valid character set type if successful
- if (cset == H5T_CSET_ERROR)
- {
+ if (cset == H5T_CSET_ERROR) {
throw DataTypeIException("StrType::getCset", "H5Tget_cset failed");
}
- return(cset);
+ return (cset);
}
//--------------------------------------------------------------------------
@@ -246,11 +246,11 @@ H5T_cset_t StrType::getCset() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void StrType::setCset(H5T_cset_t cset) const
+void
+StrType::setCset(H5T_cset_t cset) const
{
herr_t ret_value = H5Tset_cset(id, cset);
- if (ret_value < 0)
- {
+ if (ret_value < 0) {
throw DataTypeIException("StrType::setCset", "H5Tset_cset failed");
}
}
@@ -265,17 +265,16 @@ void StrType::setCset(H5T_cset_t cset) const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_str_t StrType::getStrpad() const
+H5T_str_t
+StrType::getStrpad() const
{
H5T_str_t strpad = H5Tget_strpad(id);
// Returns a valid string padding type if successful
- if (strpad == H5T_STR_ERROR)
- {
- throw DataTypeIException("StrType::getStrpad",
- "H5Tget_strpad failed - returned H5T_STR_ERROR");
+ if (strpad == H5T_STR_ERROR) {
+ throw DataTypeIException("StrType::getStrpad", "H5Tget_strpad failed - returned H5T_STR_ERROR");
}
- return(strpad);
+ return (strpad);
}
//--------------------------------------------------------------------------
@@ -288,11 +287,11 @@ H5T_str_t StrType::getStrpad() const
/// the HDF5 C Reference Manual.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void StrType::setStrpad(H5T_str_t strpad) const
+void
+StrType::setStrpad(H5T_str_t strpad) const
{
herr_t ret_value = H5Tset_strpad(id, strpad);
- if (ret_value < 0)
- {
+ if (ret_value < 0) {
throw DataTypeIException("StrType::setStrpad", "H5Tset_strpad failed");
}
}
@@ -304,4 +303,4 @@ void StrType::setStrpad(H5T_str_t strpad) const
//--------------------------------------------------------------------------
StrType::~StrType() {}
-} // end namespace
+} // namespace H5