public void CopyNameFragment(MNDXSearchResult pStruct1C, int dwFragOffs) { SearchBuffer pStruct40 = pStruct1C.Buffer; if (FragmentEnds.TotalItemCount == 0) { while (NameFragments[dwFragOffs] != 0) { pStruct40.Add(NameFragments[dwFragOffs++]); } } else { while (!FragmentEnds.Contains(dwFragOffs)) { pStruct40.Add(NameFragments[dwFragOffs++]); } } }
public bool CheckAndCopyNameFragment(MNDXSearchResult pStruct1C, int dwFragOffs) { SearchBuffer pStruct40 = pStruct1C.Buffer; if (FragmentEnds.TotalItemCount == 0) { string szSearchMask = pStruct1C.SearchMask; var startPos = dwFragOffs - pStruct40.CharIndex; // Keep copying as long as we don't reach the end of the search mask while (pStruct40.CharIndex < pStruct1C.SearchMask.Length) { // HOTS: 195A5A0 if (NameFragments[startPos + pStruct40.CharIndex] != szSearchMask[pStruct40.CharIndex]) { return(false); } // HOTS: 195A5B7 pStruct40.Add(NameFragments[startPos + pStruct40.CharIndex]); pStruct40.CharIndex++; if (NameFragments[startPos + pStruct40.CharIndex] == 0) { return(true); } } // HOTS: 195A660 // Now we need to copy the rest of the fragment while (NameFragments[startPos + pStruct40.CharIndex] != 0) { pStruct40.Add(NameFragments[startPos + pStruct40.CharIndex]); startPos++; } } else { // Get the offset of the fragment to compare // HOTS: 195A6B7 string szSearchMask = pStruct1C.SearchMask; // Keep copying as long as we don't reach the end of the search mask while (dwFragOffs < pStruct1C.SearchMask.Length) { if (NameFragments[dwFragOffs] != szSearchMask[pStruct40.CharIndex]) { return(false); } pStruct40.Add(NameFragments[dwFragOffs]); pStruct40.CharIndex++; // Keep going as long as the given bit is not set if (FragmentEnds.Contains(dwFragOffs++)) { return(true); } } // Now we need to copy the rest of the fragment while (!FragmentEnds.Contains(dwFragOffs)) { // HOTS: 195A7A6 pStruct40.Add(NameFragments[dwFragOffs]); dwFragOffs++; } } return(true); }