| 61 | std::unordered_map<std::pair<StringTableEntry, StringTableEntry>, Namespace*> gNamespaceCache; |
| 62 | |
| 63 | bool canTabComplete(const char *prevText, const char *bestMatch, |
| 64 | const char *newText, S32 baseLen, bool fForward) |
| 65 | { |
| 66 | // test if it matches the first baseLen chars: |
| 67 | if (dStrnicmp(newText, prevText, baseLen)) |
| 68 | return false; |
| 69 | |
| 70 | if (fForward) |
| 71 | { |
| 72 | if (!bestMatch) |
| 73 | return dStricmp(newText, prevText) > 0; |
| 74 | else |
| 75 | return (dStricmp(newText, prevText) > 0) && |
| 76 | (dStricmp(newText, bestMatch) < 0); |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | if (dStrlen(prevText) == (U32)baseLen) |
| 81 | { |
| 82 | // look for the 'worst match' |
| 83 | if (!bestMatch) |
| 84 | return dStricmp(newText, prevText) > 0; |
| 85 | else |
| 86 | return dStricmp(newText, bestMatch) > 0; |
| 87 | } |
| 88 | else |
| 89 | { |
| 90 | if (!bestMatch) |
| 91 | return (dStricmp(newText, prevText) < 0); |
| 92 | else |
| 93 | return (dStricmp(newText, prevText) < 0) && |
| 94 | (dStricmp(newText, bestMatch) > 0); |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | //--------------------------------------------------------------- |
| 100 | // |
no test coverage detected