本文整理汇总了C++中TBuf8::NumFixedWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ TBuf8::NumFixedWidth方法的具体用法?C++ TBuf8::NumFixedWidth怎么用?C++ TBuf8::NumFixedWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TBuf8
的用法示例。
在下文中一共展示了TBuf8::NumFixedWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructL
void CRpsMsg::ConstructL(const TDesC8& aMsgType, const TDesC8& aOpCode, const TUint aMsgNum, const CDesCArrayFlat& aArgArray)
{
TUint numArgs(aArgArray.Count());
iMsgDataArray = new (ELeave)CDesC8ArrayFlat(1);
// Calc the total msg length
TUint msgLen(KRqstLengthNoOpCodeNoArgsNoCommas + aOpCode.Length());
for(TInt i(0); i < numArgs; ++i)
{
msgLen += aArgArray.MdcaPoint(i).Length();
}
// add commas to calculation
msgLen += KRqstMsgElementsNoArgs + numArgs - 1;
// Msg Type
iMsgDataArray->AppendL(aMsgType);
iMsgDataArray->AppendL(KComma);
// Msg Len
TBuf8<KMaxMsgLenChars> mlenString;
mlenString.NumFixedWidth(msgLen, EDecimal, KMaxMsgLenChars);
iMsgDataArray->AppendL(mlenString);
iMsgDataArray->AppendL(KComma);
// Msg Seq Num
TBuf8<KMaxMsgNumChars> msnString;
//msnString.Num(NextMsgNum());
msnString.NumFixedWidth(aMsgNum, EDecimal, KMaxMsgNumChars);
iMsgDataArray->AppendL(msnString);
iMsgDataArray->AppendL(KComma);
// OpCode
iMsgDataArray->AppendL(aOpCode);
iMsgDataArray->AppendL(KComma);
// Arguments. Convert aArgArray data to 8-bit as we go.
for(TInt i(0); i < numArgs; ++i)
{
TBuf8<KMaxElementSize> buf;
buf.Copy(aArgArray.MdcaPoint(i));
iMsgDataArray->AppendL(buf);
iMsgDataArray->AppendL(KComma);
}
// EOM
iMsgDataArray->AppendL(KEOM);
}