MCPcopy Create free account
hub / github.com/Kitware/VTK / ConsumeString

Method ConsumeString

Filters/Statistics/vtkStatisticsAlgorithm.cxx:689–713  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

687
688//------------------------------------------------------------------------------
689std::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//------------------------------------------------------------------------------
716std::size_t vtkStatisticsAlgorithm::ConsumeStringTuple(

Callers 1

Calls 3

emptyMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected