You Are Here:

Community: Blogs

Paul Todd's Forum Nokia Blog

Serialize data

Paul.Todd | 24 May, 2007 00:21

I saw an intersting post today about what is the quickest way to serialize a structure.

To do this the proper way there are three alternatives:

Write out the structure member by member using the RWriteStream classes specialized for files - RFileWriteStream
Read them back with the relevant RReadStream classes - RFileReadStream

Write InternalizeL and ExternalizeL functions to serialize the data.

Thirdly there is actually however a much simpler solution which generates much less problems, using the TPckgC/TPckg classes.

These class wrap a struct into a TPtr8 which make make it much easier to read and write

Structure:
struct TTestStruct
    {
    TInt         iInt;
    TBuf<32>    iString;
    };

To write:
const TPckgC<TTestStruct> pkgOut(tmp);
User::LeaveIfError(file.Write(pkgOut));

To read:

TTestStruct nw;
TPckg<TTestStruct> pkgIn(nw);
User::LeaveIfError(file.Read(0, pkgIn));

OR

TPckgBuf<TTestStruct> pkgIn;
User::LeaveIfError(file.Read(0, pkgIn));
.... do something with pkgIn().iString etc.

I was going to point you folks to the descriptors blog on blogspot but strangly enough I could'nt find anything there about it.

Maybe Jo will add a section for these useful classes (TPckg, TPckgC and TPckgBuf)?

What does this mean for Symbian Signed

Paul.Todd | 14 May, 2007 12:08

I see F-Secure are now apparently flagging two Symbian signed applications as Spyware in their mobile security application.

I follow their blog quite often in my reader and this came up today:
http://www.f-secure.com/weblog/archives/archive-052007.html#00001190

They do not however publish the names of the products concerned.

This does rather interestingly lead to the question of where does Symbian Signed draw the line and just how much trust do we have in it to promote S60 as a safe platform for consumers?

I for one find this very dissapointing as the amount of money we (the company I work for, not a phone manufacturer) are spending on Symbian signed; and the program as a whole to build trust for consumers can so easily be undermined.

I hope the author or Nokia will go into more details about why these applications are flagged....

Hopefully this is just a misunderstanding on the part of F-Secure...

Still it looks like you will need to get AV software for your phone just like Windows
 
 

Rate This

 
 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZrelationQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtitleQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qdcZtypeQUqfnZE44istributionQ qdcZtypeQUqfnZSiteQ qdcZtypeQUqvocZTermQ qdcZtypeQUqvocZVocabularyConstructQ qdcZtypeQUqwebZSiteQ qdcZtypeQUqrdfsZE52esourceQ qswZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX quriE71aZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qvocZpartOfQUqfnZPublicationQ qwebZserviceQUxhttpE3aE2fE2fswE2enokiaE2ecomE2furiE71aX qrdfZtypeQUqfnZE44istributionQ qrdfZtypeQUqfnZSiteQ qrdfZtypeQUqvocZTermQ qrdfZtypeQUqvocZVocabularyConstructQ qrdfZtypeQUqwebZSiteQ qrdfZtypeQUqrdfsZE52esourceQ qrdfsZisE44efinedByQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZlabelQSxForumE20NokiaE20BlogsE20WebE20SiteXLen qrdfsZseeAlsoQUxhttpE3aE2fE2fswE2enokiaE2ecomE2fschemasE2fnokiaE2fFNE2d1E2e58E2eowlX