@@ -12,7 +12,7 @@ bool RapidJsonHandler::Null()
1212 return false ;
1313
1414 TreeNode *parent = m_NodeStack.top ();
15- HandleArray (parent, STR_NULL, false );
15+ InsertToTree (parent, STR_NULL, false );
1616 return true ;
1717}
1818
@@ -22,7 +22,7 @@ bool RapidJsonHandler::Bool(bool b)
2222 return false ;
2323
2424 TreeNode *parent = m_NodeStack.top ();
25- HandleArray (parent, b ? STR_TRUE : STR_FALSE, false );
25+ InsertToTree (parent, b ? STR_TRUE : STR_FALSE, false );
2626 return true ;
2727}
2828
@@ -57,7 +57,7 @@ bool RapidJsonHandler::RawNumber(const Ch *str, unsigned /*length*/, bool /*copy
5757 return false ;
5858
5959 TreeNode *parent = m_NodeStack.top ();
60- HandleArray (parent, str, false );
60+ InsertToTree (parent, str, false );
6161 return true ;
6262}
6363
@@ -74,7 +74,7 @@ bool RapidJsonHandler::String(const Ch *str, unsigned /*length*/, bool /*copy*/)
7474 }
7575
7676 TreeNode *parent = m_NodeStack.top ();
77- HandleArray (parent, str, true );
77+ InsertToTree (parent, str, true );
7878
7979 return true ;
8080}
@@ -193,7 +193,7 @@ bool RapidJsonHandler::EndArray(unsigned /*elementCount*/)
193193 return true ;
194194}
195195
196- void RapidJsonHandler::HandleArray (TreeNode *node, const char *const str, bool bQuote)
196+ void RapidJsonHandler::InsertToTree (TreeNode *node, const char *const str, bool bQuote)
197197{
198198 if (!node || !str)
199199 return ;
@@ -206,7 +206,7 @@ void RapidJsonHandler::HandleArray(TreeNode *node, const char *const str, bool b
206206 }
207207 else
208208 {
209- node->node .key = std::to_string (node->counter );
209+ node->node .key = " [ " + std::to_string (node->counter ) + " ] " ;
210210 node->node .value = str;
211211 node->counter ++;
212212 }
0 commit comments