hdf5: clean up + fixes
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Christian Zimmermann 2024-02-02 19:25:09 +01:00
parent 190032729a
commit 2023d64a5f
5 changed files with 3 additions and 7 deletions

View file

@ -71,7 +71,7 @@ namespace CNORXZ
bool Dataset::exists() const
{
return H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT);
return H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT) > 0;
}
Dataset& Dataset::init(const RangePtr& dataRange, hid_t type)

View file

@ -70,7 +70,6 @@ namespace CNORXZ
String File::path() const
{
//return String("/");
return "";
}

View file

@ -71,7 +71,7 @@ namespace CNORXZ
bool Group::exists() const
{
return H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT) != 0;
return H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT) > 0;
}
const ContentPtr& Group::get(const String& name) const

View file

@ -92,9 +92,7 @@ namespace CNORXZ
bool Table::exists() const
{
htri_t x = H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT);
VCHECK(x);
return x;
return H5Lexists(mParent->id(), mName.c_str(), H5P_DEFAULT) > 0;
}
Table& Table::initFieldNames(const Vector<String>& fnames)

View file

@ -131,7 +131,6 @@ namespace
File h5f(mFileName, false);
h5f.open();
h5f.getGroup("gr1")->open().addTable("tab1", mTabA, mFs);
//h5f.getGroup("gr2")->open().addTable("tab1", mTabA, mFs);
h5f.getGroup("moregroups")->open().getGroup("evenmore")->open().getGroup("need")->open().addTable("tab1", mTabA, mFs);
h5f.close();
}