Skip to content

Commit a752735

Browse files
committed
refs #426 restore legacy behaviour and hdf4 and mxml functionality
this is not a proper fix, as it changes hdf5 behaviour based on hdf4 or mxml option being enabled at runtime The purpose was to narrow down the problem. Working legacy code is a desired side outcome while implementing a better fix.
1 parent ca865ae commit a752735

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

bindings/cpp/NeXusFile.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,17 @@ AttrInfo File::getNextAttr() {
11011101
//string & name, int & length, NXnumtype type) {
11021102
char name[NX_MAXNAMELEN];
11031103
int type;
1104+
1105+
#if defined(WITH_HDF4) || defined(WITH_MXML)
1106+
int length;
1107+
NXstatus status = NXgetnextattr(this->m_file_id, name, &length, &type);
1108+
if (status == NX_OK) {
1109+
AttrInfo info;
1110+
info.type = static_cast<NXnumtype>(type);
1111+
info.length = length;
1112+
info.name = string(name);
1113+
return info;
1114+
#else
11041115
int rank;
11051116
int dim[NX_MAXRANK];
11061117
NXstatus status = NXgetnextattra(this->m_file_id, name, &rank, dim, &type);
@@ -1134,6 +1145,7 @@ AttrInfo File::getNextAttr() {
11341145
// TODO - AttrInfo cannot handle more complex ranks/dimensions, we need to throw an error
11351146
std::cerr << "ERROR iterating through attributes found array attribute not understood by this api" << std::endl;
11361147
throw Exception("getNextAttr failed", NX_ERROR);
1148+
#endif
11371149
}
11381150
else if (status == NX_EOD) {
11391151
AttrInfo info;

0 commit comments

Comments
 (0)