parseJSON() assign union with scalar value

This commit is contained in:
Michael Davidsaver
2017-09-06 18:11:42 -05:00
parent 1cb490039f
commit db6ebfe71b
5 changed files with 118 additions and 15 deletions

View File

@@ -127,6 +127,18 @@ void show_field(args& A, const pvd::PVField* fld)
A.strm.put(']');
}
break;
case pvd::union_:
{
const pvd::PVUnion *U=static_cast<const pvd::PVUnion*>(fld);
pvd::PVFieldPtr C(U->get());
if(!C) {
A.strm<<"null";
} else {
show_field(A, C.get());
}
}
break;
default:
if(A.opts.ignoreUnprintable)
A.strm<<"// unprintable field type";