| 269 | } |
| 270 | |
| 271 | int BfParserData::GetCharIdAtIndex(int findIndex) |
| 272 | { |
| 273 | if (mCharIdData == NULL) |
| 274 | return findIndex; |
| 275 | |
| 276 | int encodeIdx = 0; |
| 277 | int charId = 1; |
| 278 | int charIdx = 0; |
| 279 | while (true) |
| 280 | { |
| 281 | int cmd = DecodeInt(mCharIdData, encodeIdx); |
| 282 | if (cmd > 0) |
| 283 | charId = cmd; |
| 284 | else |
| 285 | { |
| 286 | int spanSize = -cmd; |
| 287 | if ((findIndex >= charIdx) && (findIndex < charIdx + spanSize)) |
| 288 | return charId + (findIndex - charIdx); |
| 289 | charId += spanSize; |
| 290 | charIdx += spanSize; |
| 291 | |
| 292 | if (cmd == 0) |
| 293 | return -1; |
| 294 | } |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | void BfParserData::GetLineCharAtIdx(int idx, int& line, int& lineChar) |
| 299 | { |
no test coverage detected