| 728 | } |
| 729 | |
| 730 | const char *CDataFileReader::GetDataString(int Index) |
| 731 | { |
| 732 | dbg_assert(m_pDataFile != nullptr, "File not open"); |
| 733 | |
| 734 | if(Index == -1) |
| 735 | { |
| 736 | return ""; |
| 737 | } |
| 738 | |
| 739 | const int DataSize = GetDataSize(Index); |
| 740 | if(!DataSize) |
| 741 | { |
| 742 | return nullptr; |
| 743 | } |
| 744 | |
| 745 | const char *pData = static_cast<const char *>(GetData(Index)); |
| 746 | if(pData == nullptr || mem_has_null(pData, DataSize - 1) || pData[DataSize - 1] != '\0' || !str_utf8_check(pData)) |
| 747 | { |
| 748 | return nullptr; |
| 749 | } |
| 750 | return pData; |
| 751 | } |
| 752 | |
| 753 | void CDataFileReader::ReplaceData(int Index, char *pData, size_t Size) |
| 754 | { |
nothing calls this directly
no test coverage detected