diff --git a/src/factory/printer.cpp b/src/factory/printer.cpp index 846f2def..c5ee330c 100644 --- a/src/factory/printer.cpp +++ b/src/factory/printer.cpp @@ -401,12 +401,11 @@ void printRaw(std::ostream& strm, const PVStructure::Formatter& format, const PV std::ostream& operator<<(std::ostream& strm, const PVStructure::Formatter& format) { - if(format.xfmt==PVStructure::Formatter::JSON) { + if(format.xfmt==PVStructure::Formatter::JSON || \ + format.xfmt==PVStructure::Formatter::JSON5) { JSONPrintOptions opts; opts.multiLine = false; -#if EPICS_VERSION_INT>=VERSION_INT(7,0,6,1) - opts.json5 = true; -#endif + opts.json5 = format.xfmt==PVStructure::Formatter::JSON5 ? true : false; printJSON(strm, format.xtop, format.xshow ? *format.xshow : BitSet().set(0), opts); strm<<'\n'; return strm; diff --git a/src/pv/pvData.h b/src/pv/pvData.h index a33fb0eb..da88c2d0 100644 --- a/src/pv/pvData.h +++ b/src/pv/pvData.h @@ -881,6 +881,7 @@ class epicsShareClass PVStructure : public PVField, public BitSetSerializable Raw, NT, JSON, + JSON5, }; private: const PVStructure& xtop;