当前位置: 首页>>代码示例>>C++>>正文


C++ tstring::rbegin方法代码示例

本文整理汇总了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;
}
开发者ID:chrisoldwood,项目名称:FarmMonitor,代码行数:31,代码来源:QueryRunner.cpp

示例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);
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例3: GuaranteeSeparator

void Path::GuaranteeSeparator( tstring& path )
{
    if ( !path.empty() && *path.rbegin() != s_InternalPathSeparator )
    {
        path += s_InternalPathSeparator;
    }
}
开发者ID:andyburke,项目名称:Replicant,代码行数:7,代码来源:Path.cpp

示例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);
}
开发者ID:yuexiaoyun,项目名称:tortoisesvn,代码行数:23,代码来源:ShellCache.cpp

示例5:

	/**
		@brief	パスのファイル名への追加
		@param	tstrPath	パス文字列
		@param	tszFName	追加するファイル名
		@retval	tstrPath	ファイル名を追加したパス
	 */
	static void	AddFilename( tstring& tstrPath, const _TCHAR* tszFName )
	{
		if( *tstrPath.rbegin() != '\\' )tstrPath += "\\";
		tstrPath += tszFName;
	}
开发者ID:ecyberx,项目名称:test,代码行数:11,代码来源:simplefilesrch.hpp


注:本文中的tstring::rbegin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。