×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    22

    How to extract Data from OnContentL( )

    Hai Guys,
    Can Anybody please tell me How to extract the content information from const TDesC8 &aBytes in

    void CXmlHandler::OnContentL( const TDesC8 &aBytes, TInt aErrorCode )

    because in SDK help I read that

    "This method is a callback that sends the content of the element. Not all the content may be returned in one go. The data may be sent in chunks. When an OnEndElementL is received this means there is no more content to be sent."

    "const TDesC8 &aBytes is the raw content data for the element. The client is responsible for converting the data to the required character set if necessary. In some instances the content may be binary and must not be converted."

    Frankly speaking I didn't understood much. Please help me

    Regards,
    PPR

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to extract Data from OnContentL( )

    Hi

    do the following in your OnContentL().

    HBufC8* iData = NULL;
    void CMyDemo::OnContentL(const TDesC8& aBytes, TInt aErrorCode)
    {
    iData = HBufC8::NewL(aBytes.Length());
    iData->Des().Append(aBytes);
    }

    Now iData will contain your data.

    savaj....

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    22

    Re: How to extract Data from OnContentL( )

    Thank u VERY much yaar savaj

    PPR

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: How to extract Data from OnContentL( )

    But remember that the documentation said "Not all the content may be returned in one go" so thats not going to correspond to iData = HBufC8::NewL(aBytes.Length()); being within OnContentL().

  5. #5
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to extract Data from OnContentL( )

    ya hotcheese, it is neccessary to initialize "iData" somewhere else (other than OnContentL()) and realloc it in OnContentL(), otherwise it may cause memory leak.

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: How to extract Data from OnContentL( )

    Its not a memory leak that is an issue, I was pointing out that if prabhupingili copied your code exactly as you pasted it(as he is a beginner he probably will do) then if OnContentL() is called more than once then the previous contents of iData will have been lost. You might have realised that, but not him.

Similar Threads

  1. 3G Voice Call and simultaneous data connection
    By olshevch in forum General Development Questions
    Replies: 8
    Last Post: 2009-12-19, 14:26
  2. Replies: 3
    Last Post: 2008-09-09, 04:53
  3. I need to extract sms inbox data by midlet
    By farhanx in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2006-10-01, 20:05
  4. Replies: 4
    Last Post: 2006-08-30, 10:15
  5. Unicode Song Title In NSM Ringtone
    By mcai7db3 in forum Smart Messaging
    Replies: 3
    Last Post: 2002-08-28, 06:58

Posting Permissions

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