Skip to content

Commit

Permalink
json: workaround for const char* storage
Browse files Browse the repository at this point in the history
Convert produced data into normal JSON string.
Zero-string converted to null.

Signed-off-by: Sergey Linev <[email protected]>
  • Loading branch information
linev authored and pcanal committed Nov 7, 2016
1 parent 0d91d94 commit e2c5725
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion io/io/src/TBufferJSON.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1389,13 +1389,17 @@ void TBufferJSON::PerformPostProcessing(TJSONStackObj *stack,

const char *typname = elem->IsBase() ? elem->GetName() : elem->GetTypeName();
Bool_t isTObject = (elem->GetType() == TStreamerInfo::kTObject) || (strcmp("TObject", typname) == 0);
Bool_t isCharStar = elem->GetType() == TStreamerInfo::kCharStar;
Bool_t isTString = elem->GetType() == TStreamerInfo::kTString;
Bool_t isSTLstring = elem->GetType() == TStreamerInfo::kSTLstring;
Bool_t isOffsetPArray = (elem->GetType() > TStreamerInfo::kOffsetP) && (elem->GetType() < TStreamerInfo::kOffsetP + 20);

Bool_t isTArray = (strncmp("TArray", typname, 6) == 0);

if (isTString || isSTLstring) {
if (isCharStar) {
stack->fValues.Delete();
if (fValue == "0") fValue = "null";
} else if (isTString || isSTLstring) {
// just remove all kind of string length information

if (gDebug > 3)
Expand Down

0 comments on commit e2c5725

Please sign in to comment.