diff --git a/slsReceiverSoftware/src/MasterAttributes.cpp b/slsReceiverSoftware/src/MasterAttributes.cpp index 743baeedb..ded5589da 100644 --- a/slsReceiverSoftware/src/MasterAttributes.cpp +++ b/slsReceiverSoftware/src/MasterAttributes.cpp @@ -3,7 +3,7 @@ #include "MasterAttributes.h" void MasterAttributes::GetBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->StartObject(); GetCommonBinaryAttributes(w); switch (detType) { @@ -70,7 +70,7 @@ void MasterAttributes::WriteHDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetCommonBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Version"); w->SetMaxDecimalPlaces(2); w->Double(BINARY_WRITER_VERSION); @@ -112,7 +112,7 @@ void MasterAttributes::GetCommonBinaryAttributes( } void MasterAttributes::GetFinalBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { // adding few common parameters to the end if (!additionalJsonHeader.empty()) { w->Key("Additional Json Header"); @@ -533,7 +533,7 @@ void MasterAttributes::WriteHDF5DbitList(H5File *fd, Group *group) { #endif void MasterAttributes::GetGotthardBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Exptime"); w->String(sls::ToString(exptime).c_str()); w->Key("Period"); @@ -551,7 +551,7 @@ void MasterAttributes::WriteGotthardHDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetJungfrauBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Exptime"); w->String(sls::ToString(exptime).c_str()); w->Key("Period"); @@ -572,7 +572,7 @@ void MasterAttributes::WriteJungfrauHDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetEigerBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Dynamic Range"); w->Uint(dynamicRange); w->Key("Ten Giga"); @@ -611,7 +611,7 @@ void MasterAttributes::WriteEigerHDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetMythen3BinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Dynamic Range"); w->Uint(dynamicRange); w->Key("Ten Giga"); @@ -648,7 +648,7 @@ void MasterAttributes::WriteMythen3HDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetGotthard2BinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Exptime"); w->String(sls::ToString(exptime).c_str()); w->Key("Period"); @@ -666,7 +666,7 @@ void MasterAttributes::WriteGotthard2HDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetMoenchBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Exptime"); w->String(sls::ToString(exptime).c_str()); w->Key("Period"); @@ -690,7 +690,7 @@ void MasterAttributes::WriteMoenchHDF5Attributes(H5File *fd, Group *group) { #endif void MasterAttributes::GetCtbBinaryAttributes( - rapidjson::Writer *w) { + rapidjson::PrettyWriter *w) { w->Key("Exptime"); w->String(sls::ToString(exptime).c_str()); w->Key("Period"); diff --git a/slsReceiverSoftware/src/MasterAttributes.h b/slsReceiverSoftware/src/MasterAttributes.h index 66ae25016..34479bfb0 100644 --- a/slsReceiverSoftware/src/MasterAttributes.h +++ b/slsReceiverSoftware/src/MasterAttributes.h @@ -8,7 +8,7 @@ #include "sls/sls_detector_defs.h" #include -#include +#include #ifdef HDF5C #include "H5Cpp.h" @@ -65,15 +65,15 @@ class MasterAttributes { MasterAttributes() = default; ~MasterAttributes() = default; - void GetBinaryAttributes(rapidjson::Writer *w); + void GetBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteHDF5Attributes(H5File *fd, Group *group); #endif void - GetCommonBinaryAttributes(rapidjson::Writer *w); + GetCommonBinaryAttributes(rapidjson::PrettyWriter *w); void - GetFinalBinaryAttributes(rapidjson::Writer *w); + GetFinalBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteCommonHDF5Attributes(H5File *fd, Group *group); void WriteFinalHDF5Attributes(H5File *fd, Group *group); @@ -105,42 +105,42 @@ class MasterAttributes { #endif void - GetGotthardBinaryAttributes(rapidjson::Writer *w); + GetGotthardBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteGotthardHDF5Attributes(H5File *fd, Group *group); #endif void - GetJungfrauBinaryAttributes(rapidjson::Writer *w); + GetJungfrauBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteJungfrauHDF5Attributes(H5File *fd, Group *group); #endif void - GetEigerBinaryAttributes(rapidjson::Writer *w); + GetEigerBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteEigerHDF5Attributes(H5File *fd, Group *group); #endif void - GetMythen3BinaryAttributes(rapidjson::Writer *w); + GetMythen3BinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteMythen3HDF5Attributes(H5File *fd, Group *group); #endif void - GetGotthard2BinaryAttributes(rapidjson::Writer *w); + GetGotthard2BinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteGotthard2HDF5Attributes(H5File *fd, Group *group); #endif void - GetMoenchBinaryAttributes(rapidjson::Writer *w); + GetMoenchBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteMoenchHDF5Attributes(H5File *fd, Group *group); #endif - void GetCtbBinaryAttributes(rapidjson::Writer *w); + void GetCtbBinaryAttributes(rapidjson::PrettyWriter *w); #ifdef HDF5C void WriteCtbHDF5Attributes(H5File *fd, Group *group); #endif diff --git a/slsReceiverSoftware/src/MasterFileUtility.cpp b/slsReceiverSoftware/src/MasterFileUtility.cpp index 0ae1dc57d..56f017fa2 100644 --- a/slsReceiverSoftware/src/MasterFileUtility.cpp +++ b/slsReceiverSoftware/src/MasterFileUtility.cpp @@ -34,7 +34,7 @@ std::string CreateMasterBinaryFile(const std::string filePath, } rapidjson::StringBuffer s; - rapidjson::Writer writer(s); + rapidjson::PrettyWriter writer(s); attr->GetBinaryAttributes(&writer); std::string message = s.GetString(); if (fwrite((void *)message.c_str(), 1, message.length(), fd) !=