| 100 | |
| 101 | |
| 102 | LogMetaData::Records LogMetaData::GetMetaDataRecords(const bool upcase_label, |
| 103 | const bool logtag_encaps) const |
| 104 | { |
| 105 | Records ret; |
| 106 | for (const auto &mdc : metadata) |
| 107 | { |
| 108 | std::string label = mdc->label; |
| 109 | if (upcase_label) |
| 110 | { |
| 111 | std::transform(label.begin(), |
| 112 | label.end(), |
| 113 | label.begin(), |
| 114 | [](unsigned char c) |
| 115 | { |
| 116 | return std::toupper(c); |
| 117 | }); |
| 118 | } |
| 119 | if (LogMetaDataValue::Type::LOGMETA_LOGTAG == mdc->type) |
| 120 | { |
| 121 | ret.push_back(label + "=" + mdc->GetValue(logtag_encaps)); |
| 122 | } |
| 123 | else |
| 124 | { |
| 125 | ret.push_back(label + "=" + mdc->GetValue()); |
| 126 | } |
| 127 | } |
| 128 | return ret; |
| 129 | } |
| 130 | |
| 131 | |
| 132 | size_t LogMetaData::size() const |