To Find a Character in HBufC8

Login to reply to this topic.
Thu, 2007-09-27 19:32
Joined: 2007-09-04
Forum posts: 19


Hi all,

I am using HBufC8 in the following code snippet:
HBufC8 *opaquedata =(Array[i]->OpaqueData()).AllocL();
where Array[i]->OpaqueData() is of type TDesC8.
Now i want to find the substring in this. How can I do that.

if I use *opaquedata.Find(substring), It is giving compilation errors. How do I find the substring in HBufC8


Thu, 2007-09-27 19:49
Joined: 2004-12-07
Forum posts: 72
Re: To Find a Character in HBufC8

What is type of substring? it should be TDesC if you use Find().

Thu, 2007-09-27 19:52
Joined: 2007-09-04
Forum posts: 19
Re: To Find a Character in HBufC8

The Type of the substring is Lieral value.

e.g. _LIT(Substring, " " );
can u please tell the code snippet

Thu, 2007-09-27 20:13
Joined: 2006-05-09
Forum posts: 78
Re: To Find a Character in HBufC8

You need to make it a _LIT8

Fri, 2007-09-28 04:58
Joined: 2004-05-21
Forum posts: 286
Re: To Find a Character in HBufC8

1. What does OpaqueData() returns? If it is returning a descriptor why you want to make a copy of that?
2. The way you are calling find is wrong. You are calling as *opaquedata.Find but opaquedata is a pointer. So you should be calling opaquedata->Find.

Cheers,
Sri

  • Login to reply to this topic.