本文整理汇总了C++中TDes::Right方法的典型用法代码示例。如果您正苦于以下问题:C++ TDes::Right方法的具体用法?C++ TDes::Right怎么用?C++ TDes::Right使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDes
的用法示例。
在下文中一共展示了TDes::Right方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFileNameForSwpL
/**
Construct a descriptor containing the composite file name from the DLL to load
@param aSwp The swp to create the file name for
@param aLibraryFilename reference to object in which file name is returned
@leave KErrNotFound If the swp is not registered
*/
void CSsmSwpPolicyResolver::GetFileNameForSwpL(const TSsmSwp& aSwp, TDes& aLibraryFilename) const
{
aLibraryFilename.Zero();
aLibraryFilename.Append(KRomDriveLetter);
aLibraryFilename.Append(iSwpPolicyMap->FilenameL(aSwp.Key()));
const TInt postfixLength = KDllFilenamePostfix().Length();
if(KDllFilenamePostfix().CompareF(aLibraryFilename.Right(postfixLength)))
{
aLibraryFilename.Append(KDllFilenamePostfix);
}
}
示例2: ResolveDirectionality
/**
Resolves directionality of the given source text.
Place-holder strings are removed so that they don't affect the result.
*/
TBidiText::TDirectionality CResourceLoader::ResolveDirectionality(TDes& aText, TBool* aFound)
{
TInt i = 0;
// Remove place-holders from string so they don't affect directionality
// length parameters e.g. "[29]" do not contain strongly directional
// characters so can ignore them.
while (i < aText.Length())
{
TPtrC remainder = aText.Right(aText.Length() - i);
TInt nextKey = remainder.Locate(KKeyPrefix);
i += nextKey;
if (nextKey != KErrNotFound && i < aText.Length() - 1)
{
TInt lastCharInKey = i + 1;
// skip possible key index
TText t = aText[lastCharInKey];
if (t >= '0' && t <= '9')
{
lastCharInKey++;
if (lastCharInKey < aText.Length())
{
t = aText[lastCharInKey];
if (t >= '0' && t <= '9')
{
lastCharInKey++;
}
}
}
// lastCharInKey is now the index of 'N' or 'U' in the key
if (lastCharInKey < aText.Length())
{
TText t = aText[lastCharInKey];
if (t == 'U' || t == 'N')
{
// found key, delete it and continue loop to
// search for the next key
aText.Delete(i, lastCharInKey - i + 1);
}
// This was not a proper key - check the remaining string
else
{
i = lastCharInKey + 1;
}
}
// end of string encountered - stop
else
{
break;
}
}
// no key found - stop
else
{
break;
}
}
return TBidiText::TextDirectionality(aText, aFound);
}