如何连接各种 Symbian 描述符

发布于 2024-10-19 03:49:46 字数 544 浏览 6 评论 0原文

我在使用 Symbian 描述符时遇到一些困难。我本质上希望采用各种描述符并将它们连接在一起形成一个更大的描述符,也许将它们放入 RBuf 中。此外,程序运行的每种类型的数据长度都会发生变化,下面是我一直在使用但无法构建的一些骨架代码。

HBufC8 * aVar = someObj.aVarData();
HBufC * anotherVar = someObj.anotherVarData();
HBuf8 * someVar = someObj.someVarData();

//Perform some operation to convert the descriptors to the same type and add them to a RBuf;

RBuf toLog;
toLog.CreateL( _L("Info to Log"));
toLog.Append( aVar );
toLog.Append( anotherVar );
toLog.Append( someVar );

正如您从评论中看到的那样,我无法正确弄清楚如何转换描述符并将其添加到缓冲区。提前致谢。

I am having some difficulty working with Symbian descriptors. I would essentially like to take various descriptors and concat them together into one larger descriptor, perhaps placing them into an RBuf. Also the pieces of data will change in length each type the program runs, below is a bit of skeleton code I have been playing around with but have not been able to build.

HBufC8 * aVar = someObj.aVarData();
HBufC * anotherVar = someObj.anotherVarData();
HBuf8 * someVar = someObj.someVarData();

//Perform some operation to convert the descriptors to the same type and add them to a RBuf;

RBuf toLog;
toLog.CreateL( _L("Info to Log"));
toLog.Append( aVar );
toLog.Append( anotherVar );
toLog.Append( someVar );

I have not been able to correclty figure out how to convert and add the descriptors to the buffer, as you can see from the comment. Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖凝香 2024-10-26 03:49:46

Append() 采用对 TDesC 的引用作为参数。所以,你的代码应该如下所示:

toLog.Append( *aVar );
toLog.Append( *anotherVar );
toLog.Append( *someVar );

Append() takes a reference to TDesC, as a param. So, your code should be like below:

toLog.Append( *aVar );
toLog.Append( *anotherVar );
toLog.Append( *someVar );
春庭雪 2024-10-26 03:49:46

您的代码看起来大致正确。你得到什么错误?
请注意,您混合使用了 8 位和 16 位描述符类型。

阅读http://descriptors.blogspot.com/

Your code looks approximately correct. What error do you get?
Beware you are mixing 8 and 16-bit descriptor types.

Read http://descriptors.blogspot.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文