1 #ifndef AWFUL_ABF_READER_DGST_H
2 #define AWFUL_ABF_READER_DGST_H
4 namespace awful
{ namespace abf
6 template< class EndianessPolicy
> bool BaseReader
< EndianessPolicy
>::
7 ReadDGST( buffered_stream_type
& Stream
)
9 const char dgst
[] = { 'D', 'G', 'S', 'T' };
12 Stream
.read( chunkid
, sizeof( chunkid
) );
14 while( memcmp( dgst
, chunkid
, sizeof( chunkid
) ) )
16 uint32_t size
= Stream
.readU32();
17 Stream
.seek( Stream
.tell() + size
);
18 if( Stream
.read( chunkid
, sizeof( chunkid
) ) != sizeof( chunkid
) )
21 std::cout
<< "ABF reader: DGST chunk not found\n";
25 uint32_t size
= Stream
.readU32();
26 bool bDigestCheckOk
= true;
30 uint64_t digest
= Stream
.readU64();
31 bDigestCheckOk
= bDigestCheckOk
&& Impl::Digests
.find( digest
) != Impl::Digests
.end();
35 return bDigestCheckOk
;