This tutorial describes how to set the maximum buffer limit.
The purpose of this tutorial is to show you how to set the maximum size for the metadata buffer.
Required Background
The Metadata Utility Library Overview introduces the metadata client utility.
Introduction
The client can control the size of the metadata buffer by setting a maximum buffer limit. Setting the maximum buffer limit enables the client to restrict metadata buffer usage, thus ensuring it has sufficient heap for other tasks. Once this limit has been set, it is then the parser’s responsibility to stop appending metadata field items once the buffer reaches this upper limit. If the client does not set a limit, then the parser appends metadata field items until it uses the complete heap in the client thread.
The client should set the limit to an optimized value based on the following factors:
The following tasks will be covered in this tutorial:
Basic Procedure
The high level steps to set the maximum buffer limit are shown here:
Create a new metadata utility object.
Initialise a parser plug-in with an input source.
Call CMetaDataClientUtility::SetMetaDataBufferLimitL() and set aMaxBufferSize to the maximum buffer size.
IMPORT_C void SetMetaDataBufferLimitL(TInt aMaxBufferSize);
Note: Maximum buffer size must be greater than zero, otherwise it leaves with KErrArgument.