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

Method ConfigureFromAlgorithmParameters

Filters/Statistics/vtkStatisticsAlgorithm.cxx:139–166  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

137
138//------------------------------------------------------------------------------
139bool vtkStatisticsAlgorithm::ConfigureFromAlgorithmParameters(
140 const std::string& algorithmParameters)
141{
142 std::string work = algorithmParameters;
143 // Consume a parameter name, then call ConsumeNextAlgorithmParameter()
144 // to set the value. If any string remains after the value is consumed,
145 // repeat until the string is empty or a parameter cannot be consumed.
146 for (; !work.empty();)
147 {
148 std::size_t parameterNameEnd = work.find('=');
149 if (parameterNameEnd == std::string::npos)
150 {
151 vtkErrorMacro("Could not identify parameter name in \"" << work << "\".");
152 return false;
153 }
154 vtkStringToken parameterName(work.substr(0, parameterNameEnd));
155 work = work.substr(parameterNameEnd + 1, std::string::npos);
156 std::size_t consumed = this->ConsumeNextAlgorithmParameter(parameterName, work);
157 if (consumed == 0)
158 {
159 vtkErrorMacro("Could not identify parameter value for \"" << parameterName.Data()
160 << "\" in \"" << work << "\".");
161 return false;
162 }
163 work = work.substr(consumed + 1, std::string::npos);
164 }
165 return true;
166}
167
168//------------------------------------------------------------------------------
169void vtkStatisticsAlgorithm::AppendAlgorithmParameters(std::string& algorithmParameters) const

Callers 1

Calls 4

emptyMethod · 0.45
findMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected