ATLAS Offline Software
Loading...
Searching...
No Matches
H5Utils::Print Namespace Reference

Functions

std::ostream & operator<< (std::ostream &os, const H5::DataSet &ds)
 Print information about a dataset.
std::ostream & operator<< (std::ostream &os, const H5::Group &group)
 Print information about a group.

Function Documentation

◆ operator<<() [1/2]

std::ostream & H5Utils::Print::operator<< ( std::ostream & os,
const H5::DataSet & ds )

Print information about a dataset.

Definition at line 9 of file H5Print.cxx.

10 {
11 os << os.fill() << ds.getObjName();
12 return os;
13 }

◆ operator<<() [2/2]

std::ostream & H5Utils::Print::operator<< ( std::ostream & os,
const H5::Group & group )

Print information about a group.

Definition at line 15 of file H5Print.cxx.

16 {
17 std::size_t indent = os.width();
18 os << os.fill() << group.getObjName() << " {" << std::endl;
19 for (std::size_t ii = 0; ii < group.getNumObjs(); ++ii) {
20 H5G_obj_t childType = group.getObjTypeByIdx(ii);
21 std::string childName = group.getObjnameByIdx(ii);
22 switch(childType) {
23 case H5G_GROUP:
24 os << std::setw(indent+2) << group.openGroup(childName) << std::endl;
25 break;
26 case H5G_DATASET:
27 os << std::setw(indent+2) << group.openDataSet(childName) << std::endl;
28 break;
29 default:
30 // For now do nothing with other types - maybe in the future rethink
31 // this?
32 break;
33 }
34 }
35 os << std::setw(indent) << os.fill() << "}";
36 return os;
37 }