-FGPositionedRef
-FGPositioned::findWithPartialId(const std::string& aId, Filter* aFilter, int aOffset, bool& aNext)
-{
- return findWithPartial(global_identIndex, aId, aFilter, aOffset, aNext);
-}
-
-
-FGPositionedRef
-FGPositioned::findWithPartialName(const std::string& aName, Filter* aFilter, int aOffset, bool& aNext)
-{
- return findWithPartial(global_nameIndex, aName, aFilter, aOffset, aNext);
-}
-
-/**
- * Wrapper filter which proxies to an inner filter, but also ensures the
- * ident starts with supplied partial ident.
- */
-class PartialIdentFilter : public FGPositioned::Filter
-{
-public:
- PartialIdentFilter(const std::string& ident, FGPositioned::Filter* filter) :
- _inner(filter)
- {
- _ident = boost::to_upper_copy(ident);
- }
-
- virtual bool pass(FGPositioned* aPos) const
- {
- if (!_inner->pass(aPos)) {
- return false;
- }
-
- return (boost::algorithm::starts_with(aPos->ident(), _ident));
- }
-
- virtual FGPositioned::Type minType() const
- { return _inner->minType(); }
-
- virtual FGPositioned::Type maxType() const
- { return _inner->maxType(); }
-
-private:
- std::string _ident;
- FGPositioned::Filter* _inner;
-};
-
-static FGPositionedRef
-findClosestWithPartial(const SGGeod& aPos, FGPositioned::Filter* aFilter, int aOffset, bool& aNext)