MCPcopy Create free account
hub / github.com/ANTsX/ANTs / ConvertVector

Method ConvertVector

Utilities/antsCommandLineParser.h:141–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140 template <typename TValue>
141 std::vector<TValue>
142 ConvertVector(std::string optionString) const
143 {
144 // Strip whitespace at end
145 optionString.erase(optionString.find_last_not_of(" \n\r\t") + 1);
146
147 std::vector<std::string> optionElementString;
148 std::istringstream f(optionString);
149 std::string s;
150 while (std::getline(f, s, 'x'))
151 {
152 optionElementString.push_back(s);
153 }
154
155 std::vector<TValue> values;
156 for (std::vector<std::string>::const_iterator oESit = optionElementString.begin();
157 oESit != optionElementString.end();
158 ++oESit)
159 {
160 const TValue & value = this->Convert<TValue>(*oESit);
161 values.push_back(value);
162 }
163 return values;
164 }
165
166protected:
167 CommandLineParser();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected