本文整理汇总了C++中CDesCArrayFlat::MdcaPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArrayFlat::MdcaPoint方法的具体用法?C++ CDesCArrayFlat::MdcaPoint怎么用?C++ CDesCArrayFlat::MdcaPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesCArrayFlat
的用法示例。
在下文中一共展示了CDesCArrayFlat::MdcaPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: HandleEventL
//.........这里部分代码省略.........
{
// Obtain the paramValue
Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventValidate" ) ) );
TInt passhistoryParamValue;
passhistoryParamValue = GetHistoryCountParamValue();
Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent passhistoryParamValue = %d" ), passhistoryParamValue ) );
// if all required bounds are zero, there is nothing to do.
if ( passhistoryParamValue != 0)
{
// Get the configFile's path.
// If this fails, there is something badly wrong(Private folder is not there)
TInt errSCF = SetConfigFile ();
if (errSCF != KErrNone)
{
break; // Break out from Case
}
// Get the historyItemCount, If the err is raised, the file is not there
// This will lead to KSCPEventPasswordChanged event and new history file will
// be created
TInt historyItemCounter;
TInt errHC = GetHistoryItemCount( historyItemCounter );
Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
if (errHC != KErrNone)
{
break; // Break out from Case
}
// continue with the KSCPEventValidate Check
// Get the password from the paramObject
TBuf<KSCPPasscodeMaxLength> seccode;
if ( aParam.Get( KSCPParamPassword, seccode ) != KErrNone )
{
// Nothing to do anymore
Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
ERROR: KSCPEventValidate/KSCPParamPassword is != KErrNone") ));
break; // Break out from Case
}
// Hash the securitycode
TBuf<KSCPPasscodeMaxLength> securityhash;
iEventHandler->HashInput(seccode,securityhash);
// get history
CDesCArrayFlat* array = NULL;
TInt errGH = KErrNone;
array = new CDesCArrayFlat(1);
if ( array != NULL )
{
TRAPD( err2, errGH = GetHistoryArrayL( *array ) );
if ( err2 != KErrNone )
{
errGH = err2;
}
}
else
{
errGH = KErrNoMemory;
}
// If for some reason err is raised, break out
// If the Historyonfig file get deleted on the fly ex
if (errGH != KErrNone)
{
array->Reset();
delete array;
break; // Break out from Case
}
TInt correction;
correction = 0;
if ( array->Count() >= passhistoryParamValue )
{
correction = array->Count() - passhistoryParamValue;
}
// check for match
TBuf<KSCPPasscodeMaxLength> arrayItem;
// Set the historyobject
for (TInt i= 0 + correction; i < array->Count(); i++)
{
arrayItem = array->MdcaPoint(i);
if (arrayItem.Compare(securityhash) == KErrNone)
{
aOutParam.Set( KSCPParamStatus, KErrSCPInvalidCode );
Dprint ( ( _L( "EDeviceLockHistoryBuffer Failed" ) ) );
aOutParam.AddtoFailedPolices(EDeviceLockHistoryBuffer);
break;
} // End of compare IF
} // End of For
// kill the local
array->Reset();
delete array;
} // passhistoryParamValue
break;
} // end of KSCPEventValidate