Esempio n. 1
0
        public StringIdx GetStringIndex(string str)
        {
            StringIdx index;

            if (str.Length == 0)
            {
                index = new StringIdx(0);
            }
            else if (!_stringIndex.TryGetValue(str, out index))
            {
                Debug.Assert(!_streamsAreComplete);
                index = new StringIdx(_stringIndex.Count + 1); // idx 0 is reserved for empty string
                _stringIndex.Add(str, index);
            }

            return(index);
        }
Esempio n. 2
0
 public int ResolveStringIndex(StringIdx index)
 {
     return(_stringIndexMap[index.VirtIdx]);
 }
 public int ResolveStringIndex(StringIdx index)
 {
     return(_stringIndexToResolvedOffsetMap[index.MapIndex]);
 }
Esempio n. 4
0
 public int ResolveStringIndex(StringIdx index)
 {
     return(_stringHeapStartOffset + _stringIndexToHeapPositionMap[index.MapIndex]);
 }