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


C++ fstring::c_str方法代码示例

本文整理汇总了C++中fstring::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ fstring::c_str方法的具体用法?C++ fstring::c_str怎么用?C++ fstring::c_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在fstring的用法示例。


在下文中一共展示了fstring::c_str方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char* argv[])
{
	ProcessCommandLine(argc, argv);
	FCollada::Initialize(); //Needed for Mac/Linux when FCollada is statically linked.
	// In debug mode, output memory leak information and do periodic memory checks
#ifdef PLUG_CRT
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_EVERY_128_DF);
#endif

	FUTestBed testBed(logFilename.c_str(), isVerbose);

#ifndef _DEBUG
	try {
#endif
	// Set the current folder to the folder with the samples DAE files
	_chdir("Samples");

	// FMath tests
	RUN_TESTSUITE(FCTestAll)

#ifndef _DEBUG
	}
	catch (const char* sz) { testBed.GetLogFile().WriteLine(sz); }
#ifdef UNICODE
	catch (const fchar* sz) { testBed.GetLogFile().WriteLine(sz); }
#endif
	catch (...) { testBed.GetLogFile().WriteLine("Exception caught!"); }
#endif

	return 0;
}
开发者ID:Marlinc,项目名称:0ad,代码行数:31,代码来源:FCTest.cpp

示例2: StripFileFromPath

// Strip a full filename of its filename, returning the path
fstring FUFileManager::StripFileFromPath(const fstring& filename)
{
	fchar fullPath[MAX_PATH + 1];
	fstrncpy(fullPath, filename.c_str(), MAX_PATH);
	fullPath[MAX_PATH] = 0;
	fchar* lastSlash = fstrrchr(fullPath, FC('/'));
	fchar* lastBackslash = fstrrchr(fullPath, FC('\\'));
	lastSlash = max(lastSlash, lastBackslash);
	if (lastSlash != NULL) *(lastSlash + 1) = 0;
	return fstring(fullPath);
}
开发者ID:tweakoz,项目名称:orkid,代码行数:12,代码来源:FUFileManager.cpp

示例3: GetFileExtension

// Extract the file extension out of a filename
fstring FUFileManager::GetFileExtension(const fstring& _filename)
{
	fchar filename[MAX_PATH];
	fstrncpy(filename, _filename.c_str(), MAX_PATH);
	filename[MAX_PATH - 1] = 0;

	fchar* lastPeriod = fstrrchr(filename, '.');
	if (lastPeriod == NULL) return emptyFString;

	fchar* lastSlash = fstrrchr(filename, '/');
	fchar* lastBackslash = fstrrchr(filename, '\\');
	lastSlash = max(lastSlash, lastBackslash);
	if (lastSlash > lastPeriod) return emptyFString;

	fstrlower(lastPeriod + 1);	// [claforte] Untested on __PPU__, refer to definition of fstrlower.
	return fstring(lastPeriod + 1);
}
开发者ID:tweakoz,项目名称:orkid,代码行数:18,代码来源:FUFileManager.cpp

示例4: ToFStringList

// Split a fstring into multiple substrings
void FUStringConversion::ToFStringList(const fstring& value, FStringList& array)
{
	const fchar* s = value.c_str();

	// Skip beginning white spaces
	fchar c;
	while ((c = *s) != 0 && (c == ' ' || c == '\t' || c == '\r' || c == '\n')) { ++s; }

	size_t index = 0;
	while (*s != 0)
	{
		const fchar* word = s;

		// Find next white space
		while ((c = *s) != 0 && c != ' ' && c != '\t' && c != '\r' && c != '\n') { ++s; }

		if (index < array.size()) array[index++].append(word, s - word);
		else { array.push_back(fstring(word, s - word)); ++index; }

		// Skip all white spaces
		while ((c = *s) != 0 && (c == ' ' || c == '\t' || c == '\r' || c == '\n')) { ++s; }
	}
	array.resize(index);
}
开发者ID:righnatios,项目名称:0ad,代码行数:25,代码来源:FUStringConversion.cpp

示例5: SetName

void FCDEntityInstance::SetName(const fstring& _name) 
{
	name = FCDEntity::CleanName(_name.c_str());
	SetDirtyFlag();
}
开发者ID:BSVino,项目名称:fcolladaCE,代码行数:5,代码来源:FCDEntityInstance.cpp

示例6: super

BadChecksumException::
BadChecksumException(fstring msg, uint64_t Old, uint64_t New)
  : super(msg.c_str()), m_old(Old), m_new(New) {}
开发者ID:GreatStone,项目名称:terark-db,代码行数:3,代码来源:checksum_exception.cpp


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