| 148 | } |
| 149 | |
| 150 | void TextReader::parseUnquotedHeader(const std::string& header) |
| 151 | { |
| 152 | auto isspecial = [](char c) |
| 153 | { return (!std::isalnum(c)); }; |
| 154 | |
| 155 | // If the separator wasn't provided on the command line extract it |
| 156 | // from the header line. |
| 157 | if (!m_separatorArg->set()) |
| 158 | { |
| 159 | // Scan string for some character not a number or letter. |
| 160 | for (size_t i = 0; i < header.size(); ++i) |
| 161 | // Parenthesis around special to prevent macro expansion, see #3190 |
| 162 | if ((isspecial)(header[i])) |
| 163 | { |
| 164 | m_separator = header[i]; |
| 165 | break; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | if (m_separator != ' ') |
| 170 | m_dimNames = Utils::split(header, m_separator); |
| 171 | else |
| 172 | m_dimNames = Utils::split2(header, m_separator); |
| 173 | |
| 174 | for (auto& s : m_dimNames) |
| 175 | { |
| 176 | Utils::trim(s); |
| 177 | size_t cnt = Dimension::extractName(s, 0); |
| 178 | if (cnt != s.size()) |
| 179 | throwError("Invalid character '" + std::string(1, s[cnt]) + |
| 180 | "' in dimension name."); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | |
| 185 | void TextReader::initialize(PointTableRef table) |
nothing calls this directly
no test coverage detected