@@ -56,7 +56,7 @@ bool /* continue */ skipLdArgs(
56
56
continue ;
57
57
}
58
58
59
- const std::string argVal = (*pIt)-> second . get_value <std::string>( );
59
+ const std::string argVal = getStringValue (*pIt);
60
60
if (argVal == " --preload" )
61
61
goto skip_arg;
62
62
@@ -103,7 +103,7 @@ void readExeArgs(
103
103
break ;
104
104
105
105
*pArgs += " " ;
106
- *pArgs += it-> second . get_value <std::string>( );
106
+ *pArgs += getStringValue (it );
107
107
}
108
108
}
109
109
@@ -144,12 +144,12 @@ std::string readMsg(const pt::ptree &defNode)
144
144
const pt::ptree *whatNode;
145
145
if (findChildOf (&whatNode, defNode, " what" ))
146
146
// message found in <what>...</what>
147
- return whatNode-> get_value <std::string>( );
147
+ return getStringValue (whatNode );
148
148
149
149
if (findChildOf (&whatNode, defNode, " xwhat" )
150
150
&& findChildOf (&whatNode, *whatNode, " text" ))
151
151
// message found in <xwhat><text>...</text></xwhat>
152
- return whatNode-> get_value <std::string>( );
152
+ return getStringValue (whatNode );
153
153
154
154
// message not found
155
155
return " <unknown>" ;
@@ -195,7 +195,7 @@ void readStack(Defect *pDef, const pt::ptree &stackNode)
195
195
const pt::ptree *fileNode;
196
196
if (findChildOf (&fileNode, frameNode, " file" )) {
197
197
// read absolute path of the source file
198
- noteEvt.fileName = fileNode-> get_value <std::string>( );
198
+ noteEvt.fileName = getStringValue (fileNode );
199
199
const std::string dir = valueOf<std::string>(frameNode, " dir" , " " );
200
200
if (!dir.empty ())
201
201
noteEvt.fileName = dir + " /" + noteEvt.fileName ;
@@ -206,12 +206,12 @@ void readStack(Defect *pDef, const pt::ptree &stackNode)
206
206
}
207
207
else if (findChildOf (&fileNode, frameNode, " obj" )) {
208
208
// pick path of the object file
209
- noteEvt.fileName = fileNode-> get_value <std::string>( );
209
+ noteEvt.fileName = getStringValue (fileNode );
210
210
keyEventScore = 4 ;
211
211
}
212
212
else if (findChildOf (&fileNode, frameNode, " ip" )) {
213
213
// pick address of the code in memory
214
- noteEvt.fileName = fileNode-> get_value <std::string>( );
214
+ noteEvt.fileName = getStringValue (fileNode );
215
215
keyEventScore = 2 ;
216
216
}
217
217
else {
@@ -254,9 +254,9 @@ bool ValgrindTreeDecoder::readNode(Defect *pDef, pt::ptree::const_iterator defIt
254
254
keyEvent.msg = readMsg (defNode);
255
255
256
256
// read "kind" of the report
257
- pt::ptree::const_assoc_iterator itKind = defNode. find ( " kind" );
258
- if (defNode. not_found () != itKind )
259
- keyEvent.event += " [" + itKind-> second . get_value <std::string>() + " ]" ;
257
+ const std::string kind = valueOf<std::string>(defNode, " kind" , " " );
258
+ if (!kind. empty () )
259
+ keyEvent.event += " [" + kind + " ]" ;
260
260
261
261
// go through stack trace
262
262
const pt::ptree *stackNode;
@@ -270,7 +270,7 @@ bool ValgrindTreeDecoder::readNode(Defect *pDef, pt::ptree::const_iterator defIt
270
270
DefEvent auxEvent = def.events [def.keyEventIdx ];
271
271
auxEvent.event = " note" ;
272
272
auxEvent.verbosityLevel = /* note */ 1 ;
273
- auxEvent.msg = auxwhat-> get_value <std::string>( );
273
+ auxEvent.msg = getStringValue (auxwhat );
274
274
def.events .insert (def.events .begin () + def.keyEventIdx + 1 , auxEvent);
275
275
}
276
276
0 commit comments