MCPcopy Create free account
hub / github.com/ImageEngine/cortex / readHeader

Method readHeader

src/IECore/IFFFile.cpp:165–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void IFFFile::Chunk::readHeader( std::streampos *pos )
166{
167 m_file->m_iStream->seekg( *pos, std::ios_base::beg );
168
169 // read type
170 char tagBuffer[IFFFile::Tag::TagSize];
171 m_file->m_iStream->read( tagBuffer, IFFFile::Tag::TagSize );
172 m_type = IFFFile::Tag( tagBuffer );
173
174 // read dataSize
175 m_file->m_iStream->read( (char *)&m_dataSize, sizeof(m_dataSize) );
176 m_dataSize = asBigEndian( m_dataSize );
177
178 if ( isGroup() )
179 {
180 // read groupName
181 m_file->m_iStream->read( tagBuffer, IFFFile::Tag::TagSize );
182 m_groupName = IFFFile::Tag( tagBuffer );
183
184 // modify dataSize
185 m_dataSize -= IFFFile::Tag::TagSize;
186
187 // calculate alignment quota
188 m_alignmentQuota = alignmentQuota();
189 }
190
191 // set the file position of the data
192 m_filePosition = m_file->m_iStream->tellg();
193 *pos = m_filePosition;
194}
195
196void IFFFile::Chunk::read( std::string &data )
197{

Callers 1

lsMethod · 0.45

Calls 5

TagClass · 0.85
asBigEndianFunction · 0.85
seekgMethod · 0.80
tellgMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected