@@ -41,21 +41,26 @@ CovTreeDecoder::CovTreeDecoder(InStream &input):
41
41
42
42
CovTreeDecoder::~CovTreeDecoder () = default ;
43
43
44
+ // / decode single event
45
+ static DefEvent covDecodeEvt (const pt::ptree &evtNode)
46
+ {
47
+ DefEvent evt;
48
+
49
+ evt.fileName = valueOf<std::string>(evtNode, " filePathname" );
50
+ evt.line = valueOf<int > (evtNode, " lineNumber" );
51
+ evt.column = valueOf<int > (evtNode, " columnNumber" );
52
+ evt.event = valueOf<std::string>(evtNode, " eventTag" );
53
+ evt.msg = valueOf<std::string>(evtNode, " eventDescription" );
54
+
55
+ return evt;
56
+ }
57
+
44
58
void CovTreeDecoder::Private::readEvents (Defect *def)
45
59
{
46
60
// go through the list of events
47
61
const pt::ptree &evtList = this ->pSrc ->get_child (" events" );
48
62
for (const auto &item : evtList) {
49
63
const pt::ptree &evtNode = item.second ;
50
-
51
- // decode single event
52
- DefEvent evt;
53
- evt.fileName = valueOf<std::string>(evtNode, " filePathname" );
54
- evt.line = valueOf<int > (evtNode, " lineNumber" );
55
- evt.column = valueOf<int > (evtNode, " columnNumber" );
56
- evt.event = valueOf<std::string>(evtNode, " eventTag" );
57
- evt.msg = valueOf<std::string>(evtNode, " eventDescription" );
58
-
59
64
if (evtNode.get <bool >(" main" )) {
60
65
// this is a key event
61
66
@@ -70,6 +75,7 @@ void CovTreeDecoder::Private::readEvents(Defect *def)
70
75
}
71
76
72
77
// push the event to the list of events
78
+ DefEvent evt = covDecodeEvt (evtNode);
73
79
def->events .push_back (std::move (evt));
74
80
}
75
81
}
0 commit comments