本文整理汇总了C++中tstring::rbegin方法的典型用法代码示例。如果您正苦于以下问题:C++ tstring::rbegin方法的具体用法?C++ tstring::rbegin怎么用?C++ tstring::rbegin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tstring
的用法示例。
在下文中一共展示了tstring::rbegin方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: formatIntegerValue
static tstring formatIntegerValue(uint64 value)
{
typedef tstring::reverse_iterator rev_iter;
typedef tstring::const_reverse_iterator c_rev_iter;
const tstring rawResult = Core::format<uint64>(value);
const size_t numDigits = (rawResult[0] != TXT('-')) ? rawResult.length() : (rawResult.length()-1);
const tstring separator = getGroupSeparator();
const size_t numSeps = (numDigits-1) / 3;
const size_t total = rawResult.length() + (numSeps * separator.length());
tstring result = tstring(total, TXT(' '));
c_rev_iter it = rawResult.rbegin();
c_rev_iter end = rawResult.rend();
size_t digits = 0;
size_t seps = 0;
rev_iter output = result.rbegin();
while (it != end)
{
*output++ = *it++;
if ( ((++digits % 3) == 0) && (seps++ != numSeps) )
output = std::copy(separator.rbegin(), separator.rend(), output);
}
return result;
}
示例2: ExpandEnvironmentStrings
// construct \ref data content
void ShellCache::CPathFilter::AddEntry(const tstring& s, bool include)
{
static wchar_t pathbuf[MAX_PATH * 4] = { 0 };
if (s.empty())
return;
TCHAR lastChar = *s.rbegin();
SEntry entry;
entry.hasSubFolderEntries = false;
entry.recursive = lastChar != L'?';
entry.included = include ? tristate_true : tristate_false;
entry.subPathIncluded = include == entry.recursive ? tristate_true : tristate_false;
entry.path = s;
if ((lastChar == L'?') || (lastChar == L'*'))
entry.path.erase(s.length() - 1);
if (!entry.path.empty() && (*entry.path.rbegin() == L'\\'))
entry.path.erase(entry.path.length() - 1);
auto ret = ExpandEnvironmentStrings(entry.path.c_str(), pathbuf, _countof(pathbuf));
if ((ret > 0) && (ret < _countof(pathbuf)))
entry.path = pathbuf;
data.push_back(entry);
}
示例3: GuaranteeSeparator
void Path::GuaranteeSeparator( tstring& path )
{
if ( !path.empty() && *path.rbegin() != s_InternalPathSeparator )
{
path += s_InternalPathSeparator;
}
}
示例4:
void ShellCache::CPathFilter::AddEntry (const tstring& s, bool include)
{
if (s.empty())
return;
TCHAR lastChar = *s.rbegin();
SEntry entry;
entry.hasSubFolderEntries = false;
entry.recursive = lastChar != '?';
entry.included = include ? svn_tristate_true : svn_tristate_false;
entry.subPathIncluded = include == entry.recursive
? svn_tristate_true
: svn_tristate_false;
entry.path = s;
if ((lastChar == '?') || (lastChar == '*'))
entry.path.erase (s.length()-1);
if (!entry.path.empty() && (*entry.path.rbegin() == '\\'))
entry.path.erase (entry.path.length()-1);
data.push_back (entry);
}
示例5:
/**
@brief パスのファイル名への追加
@param tstrPath パス文字列
@param tszFName 追加するファイル名
@retval tstrPath ファイル名を追加したパス
*/
static void AddFilename( tstring& tstrPath, const _TCHAR* tszFName )
{
if( *tstrPath.rbegin() != '\\' )tstrPath += "\\";
tstrPath += tszFName;
}