Skip to content

Request JSON and JSON5 string output explicitly from PVA tools #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/factory/printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/pv/pvData.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ class epicsShareClass PVStructure : public PVField, public BitSetSerializable
Raw,
NT,
JSON,
JSON5,
};
private:
const PVStructure& xtop;
Expand Down