| 263 | } |
| 264 | |
| 265 | std::vector<astr_t> TextFileParser::GetTokens(const astr_t &str, bool trim) |
| 266 | { |
| 267 | m_Trim = trim; |
| 268 | std::vector<astr_t> result; |
| 269 | |
| 270 | uint8_t *oldEnd = m_End; |
| 271 | m_Ptr = (uint8_t *)str.c_str(); |
| 272 | m_End = m_Ptr + str.size(); |
| 273 | m_EOL = m_End; |
| 274 | |
| 275 | SaveRawLine(); |
| 276 | while (m_Ptr < m_EOL) |
| 277 | { |
| 278 | SkipToData(); |
| 279 | if (IsComment()) |
| 280 | { |
| 281 | break; |
| 282 | } |
| 283 | auto buf = ObtainQuotedData(); |
| 284 | if (buf.length() != 0u) |
| 285 | { |
| 286 | result.push_back(buf); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | m_End = oldEnd; |
| 291 | return result; |
| 292 | } |
no test coverage detected