| 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 | |
| 166 | protected: |
| 167 | CommandLineParser(); |
nothing calls this directly
no outgoing calls
no test coverage detected