File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ class ValgrindTreeDecoder: public AbstractTreeDecoder {
31
31
virtual void readRoot (
32
32
const pt::ptree **pDefList,
33
33
const pt::ptree *root);
34
+
35
+ private:
36
+ Defect defPrototype = Defect(" VALGRIND_WARNING" );
34
37
};
35
38
36
39
void ValgrindTreeDecoder::readRoot (
@@ -43,11 +46,29 @@ void ValgrindTreeDecoder::readRoot(
43
46
44
47
bool ValgrindTreeDecoder::readNode (Defect *pDef, pt::ptree::const_iterator defIter)
45
48
{
49
+ static const std::string errorKey = " error" ;
50
+ if (errorKey != defIter->first )
51
+ // not a node we are interested in
52
+ return false ;
53
+
54
+ // initialize the defect structure
55
+ Defect &def = *pDef;
56
+ def = this ->defPrototype ;
57
+
58
+ // initialize the key event
59
+ def.keyEventIdx = def.events .size ();
60
+ def.events .push_back (DefEvent ());
61
+ DefEvent &keyEvent = def.events .back ();
62
+ keyEvent.event = " warning" ;
63
+
64
+ // read "kind" of the report
65
+ const pt::ptree &defNode = defIter->second ;
66
+ pt::ptree::const_assoc_iterator itKind = defNode.find (" kind" );
67
+ if (defNode.not_found () != itKind)
68
+ keyEvent.event += " [" + itKind->second .get_value <std::string>() + " ]" ;
69
+
46
70
// TODO
47
- (void ) pDef;
48
- (void ) defIter;
49
- assert (!" implemented" );
50
- return false ;
71
+ return true ;
51
72
}
52
73
53
74
struct XmlParser ::Private {
You can’t perform that action at this time.
0 commit comments