MCPcopy Create free account
hub / github.com/SuperElastix/elastix / ExactlyOneExists

Method ExactlyOneExists

Testing/itkCommandLineArgumentParser.cxx:112–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 */
111
112bool
113CommandLineArgumentParser::ExactlyOneExists(const std::vector<std::string> & keys) const
114{
115 unsigned int counter = 0;
116 for (unsigned int i = 0; i < keys.size(); ++i)
117 {
118 if (this->ArgumentExists(keys[i]))
119 {
120 ++counter;
121 }
122 }
123
124 if (counter == 1)
125 {
126 return true;
127 }
128 else
129 {
130 return false;
131 }
132
133} // end ExactlyOneExists()
134
135
136/**

Callers 1

Calls 2

ArgumentExistsMethod · 0.95
sizeMethod · 0.80

Tested by

no test coverage detected