| 73 | } |
| 74 | |
| 75 | void BinaryReader::Open( const std::vector<uint8> &binaryContent, uint32 start, uint32 count ) |
| 76 | { |
| 77 | Close(); |
| 78 | |
| 79 | if (start >= (uint32)binaryContent.size()) |
| 80 | { |
| 81 | LOG("Start element of binary content for binary reader must be smaller than content element size", Error); |
| 82 | } |
| 83 | if (count == 0) |
| 84 | { |
| 85 | count = (uint32)binaryContent.size() - start; |
| 86 | } |
| 87 | if (start+count > (uint32)binaryContent.size()) |
| 88 | { |
| 89 | LOG("Count outside of array bounds for binary reader", Error); |
| 90 | } |
| 91 | |
| 92 | std::string data(&((char*)binaryContent.data())[start], count); |
| 93 | m_pReader = new std::stringstream( data ); |
| 94 | m_Exists = true; |
| 95 | } |
| 96 | |
| 97 | void BinaryReader::Close() |
| 98 | { |
nothing calls this directly
no outgoing calls
no test coverage detected