Skip to content

Commit

Permalink
json: handle kUnordered... STL classes
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Linev <[email protected]>
  • Loading branch information
linev authored and pcanal committed Nov 7, 2016
1 parent 3257279 commit 3cb95c9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion io/io/src/TBufferJSON.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,9 @@ void TBufferJSON::JsonStartElement(const TStreamerElement *elem, const TClass *b
case TClassEdit::kList :
elem_name = "fList";
break;
case TClassEdit::kForwardist :
elem_name = "fForwardlist";
break;
case TClassEdit::kDeque :
elem_name = "fDeque";
break;
Expand All @@ -745,6 +748,18 @@ void TBufferJSON::JsonStartElement(const TStreamerElement *elem, const TClass *b
case TClassEdit::kMultiSet :
elem_name = "fMultiSet";
break;
case TClassEdit::kUnorderedSet :
elem_name = "fUnorderedSet";
break;
case TClassEdit::kUnorderedMultiSet :
elem_name = "fUnorderedMultiSet";
break;
case TClassEdit::kUnorderedMap :
elem_name = "fUnorderedMap";
break;
case TClassEdit::kUnorderedMultiMap :
elem_name = "fUnorderedMultiMap";
break;
case TClassEdit::kBitSet :
elem_name = "fBitSet";
break;
Expand Down Expand Up @@ -925,7 +940,8 @@ void TBufferJSON::JsonWriteObject(const void *obj, const TClass *cl, Bool_t chec
Int_t size = TString(stack->fValues.At(0)->GetName()).Atoi();

if ((size * 2 == stack->fValues.GetLast()) &&
((special_kind == TClassEdit::kMap) || (special_kind == TClassEdit::kMultiMap))) {
((special_kind == TClassEdit::kMap) || (special_kind == TClassEdit::kMultiMap) ||
(special_kind == TClassEdit::kUnorderedMap) || (special_kind == TClassEdit::kUnorderedMultiMap))) {
// special handling for std::map. Create entries like { 'first' : key, 'second' : value }
for (Int_t k = 1; k < stack->fValues.GetLast(); k += 2) {
fValue.Append(separ);
Expand Down

0 comments on commit 3cb95c9

Please sign in to comment.