| 784 | } |
| 785 | |
| 786 | bool CsvParser::FindFirstRowWithPid(const unsigned int& searchProcessId) |
| 787 | { |
| 788 | for (;;) { |
| 789 | if (!ReadRow(true)) { |
| 790 | break; |
| 791 | } |
| 792 | if (headerColumnIndex_[Header_ProcessID] != SIZE_MAX) { |
| 793 | auto processColIdx = headerColumnIndex_[Header_ProcessID]; |
| 794 | char const* processIdString = nullptr; |
| 795 | if (processColIdx < cols_.size()) { |
| 796 | processIdString = cols_[Header_ProcessID]; |
| 797 | unsigned int currentProcessId = 0; |
| 798 | int succeededCount = sscanf_s(processIdString, "%ud", ¤tProcessId); |
| 799 | if (searchProcessId == currentProcessId) { |
| 800 | return true; |
| 801 | } |
| 802 | } |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | return false; |
| 807 | } |
| 808 | |
| 809 | bool CsvParser::ResetCsv() |
| 810 | { |