<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - RArray of TBuf as parameter - Comments</title>
 <link>http://www.newlc.com/en/topic-18536</link>
 <description>Comments for &quot;RArray of TBuf as parameter&quot;</description>
 <language>en</language>
<item>
 <title>Re: RArray of TBuf as parameter</title>
 <link>http://www.newlc.com/en/topic-18536#comment-39035</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote from: vikasv&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;Hi,&lt;br /&gt;Use RArray&amp;lt;TPtrC&amp;gt; rather than TDesC. It works perfectly.&lt;br /&gt;&lt;br /&gt;RArray&amp;lt;TPtrC&amp;gt; values;&lt;br /&gt;TPtrC valptr;&lt;br /&gt;TBuf&amp;lt;100&amp;gt; buf = _L(&amp;quot;aaaaaaaaaaaaaa&amp;quot;);&lt;br /&gt;valptr.Set(buf);&lt;br /&gt;values.Append(valptr);&lt;br /&gt;&lt;br /&gt;try it &lt;br /&gt;Vikas&lt;br /&gt;mauj telcom&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Yes, try it and see what happens when the descriptor the TPtrC &lt;b&gt;is pointing to&lt;/b&gt; gets out of scope...&lt;br /&gt;&lt;br /&gt;void func(RArray&amp;lt;TBufC&amp;lt;100&amp;gt; &amp;gt; &amp;amp; aArray) should do the trick (with the spaces as already mentioned). Remember also that there is a size limit to the objects you put on the RArray. This is documented in the SDK. And you cannot put TDes/C objects into a RArray, since they are abstract classes.&lt;/div&gt;</description>
 <pubDate>Mon, 28 May 2007 13:40:42 +0200</pubDate>
 <dc:creator>Andreas</dc:creator>
 <guid isPermaLink="false">comment 39035 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: RArray of TBuf as parameter</title>
 <link>http://www.newlc.com/en/topic-18536#comment-39034</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi vikasv&lt;br /&gt;&lt;br /&gt;That will work, but why not use the Descriptor array&amp;#039;s provided by Symbian?&lt;br /&gt;The only reason I sugested RArray&amp;lt; TBuf&amp;lt;100&amp;gt; &amp;gt; might be used, was purely for performance reasons as RArray&amp;#039;s are quicker that CArray&amp;#039;s&lt;br /&gt;&lt;br /&gt;I&amp;#039;m not an expert, but I think that TPtrCs are slower to acces than a TBuf&amp;lt;&amp;gt; thereby decreasing the performance gain, and if you have to do conversions, performance really goes downhill. A real expert might point us in the right direction here.&lt;br /&gt;&lt;br /&gt;Therfore I would suggest using&lt;br /&gt;CPtrCArray for PtrCs&lt;br /&gt;the&lt;br /&gt;CDesCArrayxxx&lt;br /&gt;have the advantage that it owns the descriptor, so it is easy to delete the descriptors.&lt;br /&gt;&lt;br /&gt;check out the SDK documentation &amp;quot;Symbian OS v9.1 Â» Symbian OS guide Â» System libraries Â» Using BAFL Â» Descriptor Arrays&amp;quot;&lt;br /&gt;&lt;br /&gt;PS: about the performance, I could be horribly wrong, I just thought of the fact that there would typically be less to copy to the array if you only need to copy the pointer and length ie. a TPtrC&lt;/div&gt;</description>
 <pubDate>Mon, 28 May 2007 13:37:41 +0200</pubDate>
 <dc:creator>Werries</dc:creator>
 <guid isPermaLink="false">comment 39034 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: RArray of TBuf as parameter</title>
 <link>http://www.newlc.com/en/topic-18536#comment-39033</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi,&lt;br /&gt;Use RArray&amp;lt;TPtrC&amp;gt; rather than TDesC. It works perfectly.&lt;br /&gt;&lt;br /&gt;RArray&amp;lt;TPtrC&amp;gt; values;&lt;br /&gt;TPtrC valptr;&lt;br /&gt;TBuf&amp;lt;100&amp;gt; buf = _L(&amp;quot;aaaaaaaaaaaaaa&amp;quot;);&lt;br /&gt;valptr.Set(buf);&lt;br /&gt;values.Append(valptr);&lt;br /&gt;&lt;br /&gt;try it &lt;br /&gt;Vikas&lt;br /&gt;mauj telcom&lt;/div&gt;</description>
 <pubDate>Mon, 28 May 2007 07:30:34 +0200</pubDate>
 <dc:creator>vikasv</dc:creator>
 <guid isPermaLink="false">comment 39033 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: RArray of TBuf as parameter</title>
 <link>http://www.newlc.com/en/topic-18536#comment-39032</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi, the reason RArray&amp;lt;TBuf&amp;lt;100&amp;gt;&amp;gt; buf doesn&amp;#039;t compile properly is because you are basically specifying a shif operator and the compiler will expect a number followed by 2 &amp;gt;&lt;br /&gt;Rather do this&lt;br /&gt;RArray&amp;lt; TBuf&amp;lt;100&amp;gt; &amp;gt; buf&lt;br /&gt;check the spaces &amp;quot;&amp;gt; &amp;gt;&amp;quot; instead of&amp;nbsp; &amp;quot;&amp;gt;&amp;gt;&amp;quot; that should compile.&lt;br /&gt;&lt;br /&gt;RArray needs to have fixed sized members, so RArray&amp;lt;TDesC&amp;gt; buf won&amp;#039;t work,TDesC descriptors can be any maximum length.&lt;br /&gt;&lt;br /&gt;RArray&amp;lt;TDesC&amp;gt;* iParam; could work, but the _L() macro returns a TPtrC, this is not a pointer, but a class containing a pointer and the descriptor length.&lt;br /&gt;&lt;br /&gt;I would suggest if you want variable length descrptors in your array, look at SDK docs&lt;br /&gt;CPtrCArray&lt;br /&gt;CDesCArrayFlat&lt;br /&gt;CDesCArraySeg&lt;br /&gt;If you have a lot of TBuf&amp;lt;100&amp;gt;&amp;#039;s and performance is vital then use the first approach.&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Sun, 27 May 2007 01:32:27 +0200</pubDate>
 <dc:creator>Werries</dc:creator>
 <guid isPermaLink="false">comment 39032 at http://www.newlc.com</guid>
</item>
<item>
 <title>RArray of TBuf as parameter</title>
 <link>http://www.newlc.com/en/topic-18536</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/topic-18536&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/topic-18536#comments</comments>
 <category domain="http://www.newlc.com/en/forums/symbian-c">Symbian C++</category>
 <pubDate>Sat, 26 May 2007 00:14:24 +0200</pubDate>
 <dc:creator>hibelow</dc:creator>
 <guid isPermaLink="false">17971 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
