×

Discussion Board

Results 1 to 4 of 4

Thread: Hi,

  1. #1
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Hi,

    My problem is as follows.

    I'am using the http client api to connect to server and retrieve data from a database. I want to place the data into a buffer for parsing, after all of the data is received. My problem is, currently I'am adding the data received to a TBuf which is fixed size. So if the data is large, the program will fail. What is the best way of doing this. What are the classes which are most suitable for this.

    Regards,
    Jaak

  2. #2
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63
    Hi 1xuname1x,

    I think the easiest and fastest solution for you is to use the HBufC class.
    HBufC class advantage is that you can change the size of the descriptor buffer (this is achieved by reallocating the descriptor). Just to mention, reallocation is not done automatically so you will have to deal with it.

    I hope this can help you.

    Cheers,
    Sasa

  3. #3
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    Hi, this is an example how to put an uknown data to HBufC
    Code:
    if(iMyDes->Des().Length() + IWantAdd.Length() > iMyDes->Des().MaxLength()) 
    	{
    	iMyDes = iMyDes->ReAllocL(iMyDes->Length() + IWantAdd.Length());
    	}
    
    iMyDes->Des().Append( IWantAdd );

  4. #4
    Regular Contributor
    Join Date
    Dec 2003
    Posts
    470

    Info

    Thanks for the info

    Best regards,
    Jaak

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×