如何连接各种 Symbian 描述符
我在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Append() 采用对 TDesC 的引用作为参数。所以,你的代码应该如下所示:
Append() takes a reference to TDesC, as a param. So, your code should be like below:
您的代码看起来大致正确。你得到什么错误?
请注意,您混合使用了 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/