예제 #1
0
        internal bool ResolveStringsTo(StringStore store)
        {
            // If we've already resolved to this store, don't re-resolve
            if (store == this.LastResolvedStore)
            {
                return(this.LastResolveResult);
            }

            // Record we last resolved against this store and failed
            this.LastResolvedStore = store;
            this.LastResolveResult = false;

            // Look up symbol name *prefix* parts (all exact)
            for (int i = 0; i < this.SplitSymbolName8.Count - 1; ++i)
            {
                if (!store.TryFindString(this.SplitSymbolName8[i], this.IgnoreCase, out this.SymbolNamePrefixIdentifiers[i]))
                {
                    return(false);
                }
            }

            // Look up symbol name suffix (exact only if IsFullSuffix)
            if (this.IsFullSuffix)
            {
                if (!store.TryFindString(this.SymbolNameSuffix, this.IgnoreCase, out this.SymbolNameSuffixIdentifiers))
                {
                    return(false);
                }
            }
            else
            {
                if (this.SymbolNameSuffix.IsEmpty())
                {
                    this.SymbolNameSuffixIdentifiers = Range.Max;
                }
                else
                {
                    if (!store.TryGetRangeStartingWith(this.SymbolNameSuffix, out this.SymbolNameSuffixIdentifiers))
                    {
                        return(false);
                    }

                    // NOTE: Can't make a prefix Range case sensitive, so have to validate casing later
                    // Case-insensitive sort means you can have [..., array, Array, arrayList, ArrayList, ...], so no way to return case sensitive range starting with 'Array'
                }
            }

            // Look up parameters [and get the copy from the StringStore for fast comparison on signature]
            if (!store.TryFindString(this.Parameters8, this.IgnoreCase, out this.ParametersIdentifiers))
            {
                return(false);
            }
            this.Parameters8 = store[this.ParametersIdentifiers.Start];

            // If we found everything, record we succeeded
            this.LastResolveResult = true;

            return(true);
        }
예제 #2
0
        private string MatchesForPrefixToString(MemberIndex index, StringStore strings, String8 prefix)
        {
            Range matches;

            if (!strings.TryGetRangeStartingWith(prefix, out matches))
            {
                return(String.Empty);
            }
            return(MatchesToString(index, matches));
        }