- const std::ctype<char> &ct = std::use_facet<std::ctype<char> >(std::locale());
- int num_apt = _airports->size();
- char **content = new char *[num_apt + 1];
-
- int n = 0;
- for (int i = 0; i < num_apt; i++) {
- const FGAirport *apt = _airports->getAirport(i);
- std::string entry(' ' + apt->getName() + " (" + apt->getId() + ')');
-
- if (!_filter.empty()) {
- std::string upper(entry.data());
- ct.toupper((char *)upper.data(), (char *)upper.data() + upper.size());
-
- if (upper.find(_filter) == std::string::npos)
- continue;
- }
-
- content[n] = new char[entry.size() + 1];
- strcpy(content[n], entry.c_str());
- n++;
- }
- content[n] = 0;