Thursday, January 08, 2009

Symbian OS Programming: Descriptors

Some aspects of software development for Symbian OS with native C++ API can be confusing at first. The API documentation is not very generous and sometimes ambiguous.

One of the new/different concepts introduced there are the descriptors - the safer replacement for the C/C++ strings (chars arrays), that can handle binary data safely as well. There are many kinds of them TBuf TBufC, HBufC, TPtr, TPtrC, RBuf and probably some more. Some of them are stack based, the others heap based, some of them constant, some are not.

Most of the native APIs expect descriptors for parameters and when you are porting C++ code to Symbian OS the first things you have to figure out is how to provide interoperability between C/C++ strings and the descriptors, what types of descriptors to use where and how to do it more efficiently.
The following blog contains a nice set of articles on this subject and might help you to answer the remaining questions on Symbian descriptors: http://descriptors.blogspot.com.
I find the style of explanation to be different and more interesting that just digging around Symbian SDK documentation.

No comments: