本文整理汇总了C++中CUIntArray::SetAtGrow方法的典型用法代码示例。如果您正苦于以下问题:C++ CUIntArray::SetAtGrow方法的具体用法?C++ CUIntArray::SetAtGrow怎么用?C++ CUIntArray::SetAtGrow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUIntArray
的用法示例。
在下文中一共展示了CUIntArray::SetAtGrow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecodeCfgData
//----------------------------- FUNCTION -------------------------------------*
BOOL
DecodeCfgData(CByteArray const* pCfg,
CStringArray& aTexts, CUIntArray& aOffsets, CUIntArray& aLengths,
int& iTotalInputs, int& iTotalOutputs, int& iTotalInAndOuts, int& iSeq)
/*>>>>
decode slave config data bytes to string
I pCfg: cfg data structure
O aTexts: array of texts to decoded config byte(s)
O aOffsets: array with start offsets of config sequence above
O iTotalInputs total bytes of inputs and outputs (incl. <iTotalInAndOuts> !)
O iTotalOutputs
O iTotalInAndOuts total bytes which allow input and output
0 iSeq number of config sequences = number of entries in arrays
Result
TRUE if ok
<<<<*/
{
int lenCfgData = pCfg->GetSize();
BYTE* pCfgData = (BYTE*) (pCfg->GetData());
CString sCfgText;
int cntDecodedBytes;
int iOffset = 0;
int lenRead, lenWrite, lenReadAndWrite;
BOOL bConfigOK = TRUE;
iTotalInputs = 0;
iTotalOutputs = 0;
iTotalInAndOuts = 0;
iSeq = 0;
while (lenCfgData > 0)
{
cntDecodedBytes = 0;
lenRead = 0;
lenWrite = 0;
lenReadAndWrite = 0;
if (::DecodeCfgBytes(pCfgData, sCfgText,
cntDecodedBytes, lenRead, lenWrite, lenReadAndWrite))
{
aTexts.SetAtGrow(iSeq, sCfgText);
aOffsets.SetAtGrow(iSeq, iOffset);
aLengths.SetAtGrow(iSeq, cntDecodedBytes);
iOffset += cntDecodedBytes;
lenCfgData -= cntDecodedBytes;
iTotalInputs += lenRead;
iTotalOutputs += lenWrite;
iTotalInAndOuts += lenReadAndWrite;
iSeq++;
}
else
{
TRACE0("DecodeCfgData: Bad config data bytes\n");
bConfigOK = FALSE;
break;
}
};
if (lenCfgData != 0)
{
ASSERT(FALSE);
bConfigOK = FALSE;
}
return bConfigOK;
}