MCPcopy Create free account
hub / github.com/Illation/ETEngine / Open

Method Open

Engine/source/EtCore/FileSystem/BinaryReader.cpp:75–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void 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
97void BinaryReader::Close()
98{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected