------------------------------------------------------------------------------
| 687 | |
| 688 | //------------------------------------------------------------------------------ |
| 689 | std::size_t vtkStatisticsAlgorithm::ConsumeString(const std::string& source, std::string& value) |
| 690 | { |
| 691 | std::size_t consumed = 0; |
| 692 | if (source.empty()) |
| 693 | { |
| 694 | return consumed; |
| 695 | } |
| 696 | |
| 697 | value = ""; |
| 698 | char quote = source[0]; |
| 699 | // Consume until we find the matching \a quote |
| 700 | for (++consumed; consumed < source.size(); ++consumed) |
| 701 | { |
| 702 | if (source[consumed] == quote) |
| 703 | { |
| 704 | // The value will not include quotes but the return |
| 705 | // value must account for them: |
| 706 | return consumed + 1; |
| 707 | } |
| 708 | value.push_back(source[consumed]); |
| 709 | } |
| 710 | // We reached the end of the string with no terminating quote. Fail. |
| 711 | consumed = 0; |
| 712 | return consumed; |
| 713 | } |
| 714 | |
| 715 | //------------------------------------------------------------------------------ |
| 716 | std::size_t vtkStatisticsAlgorithm::ConsumeStringTuple( |
no test coverage detected