Skip to content

Commit a24db9b

Browse files
committed
Added getHeaderComments in STFReaderBase class
1 parent 94074fa commit a24db9b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/stf_reader.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ namespace stf {
4242
switch(rec->getId()) {
4343
case descriptors::internal::Descriptor::STF_COMMENT:
4444
header_comments_.emplace_back(STFRecord::grabOwnership<CommentRecord>(rec));
45+
header_comments_str_.emplace_back(header_comments_.back()->getData());
4546
break;
4647
case descriptors::internal::Descriptor::STF_ISA:
4748
stf_assert(!isa_, "Header has multiple ISA records");

stf-inc/stf_reader_base.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace stf {
3737
protected:
3838
STFRecord::ConstHandle<VersionRecord> version_; /**< Version record */
3939
std::vector<STFRecord::ConstHandle<CommentRecord>> header_comments_; /**< Header commment records */
40+
std::vector<std::string> header_comments_str_; /** String type of header comments*/
4041
std::vector<STFRecord::ConstHandle<TraceInfoRecord>> trace_info_records_; /**< Trace info records */
4142
STFRecord::ConstHandle<TraceInfoFeatureRecord> trace_features_; /**< Trace feature records */
4243

@@ -128,6 +129,17 @@ namespace stf {
128129
return trace_features_;
129130
}
130131

132+
/**
133+
* Gets the header comments
134+
*/
135+
inline const std::vector<STFRecord::ConstHandle<CommentRecord>>& getHeaderComments() const {
136+
return header_comments_;
137+
}
138+
139+
inline const std::vector<std::string>& getHeaderCommentsString() const {
140+
return header_comments_str_;
141+
}
142+
131143
/**
132144
* Returns the number of records read so far
133145
*/

0 commit comments

Comments
 (0)