void addMetaData ContentData metaData size_t size metaData getSize Dat

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
void addMetaData(ContentData & metaData)
{
size_t size = metaData.getSize();
DataInfo data(metaData);
data.setFlag(DataInfo::STOP_DECODE);
const uint8_t * ptr = 0;
if ( metaData.getData(ptr, size) == size )
{
data.extraInfo.encoding = checkUtf8( (const char *)ptr, size ) ? UTF8 : UTF16;
}
else
{
DecoderTmpBuffer buf(*_ctx.allocator);
buf.create(size);
DecoderDataChunk descr;
for ( bool success = metaData.getFirstBlock( descr ); success; success = metaData.getNextBlock( descr ) )
buf.write( descr.data, descr.size );
data.extraInfo.encoding = checkUtf8( (const char *)buf.getData(), buf.size() ) ? UTF8 : UTF16;
}
_nestedData.push_back(data);
}