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


C++ VString::AppendCString方法代码示例

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


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

示例1: AppendRawData

void AXMLAttribute::AppendRawData(VString &pDestination) const
{
	pDestination.AppendString(fName);
	pDestination.AppendCString("=\"");
	pDestination.AppendString(fValue);
	pDestination.AppendCString("\"");
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:7,代码来源:XMLGenerator.cpp

示例2: SetIndent

void AXMLGenericElement::SetIndent(VString &pDestination) const
{
	long	i;

#if WINVER
	pDestination.AppendCString("\r\n");
#else
	pDestination.AppendCString("\n");
#endif
	for(i = 1;i <= fLevel;i++)
		pDestination.AppendCString("\t");
}
开发者ID:StephaneH,项目名称:core-XToolbox,代码行数:12,代码来源:XMLGenerator.cpp

示例3: GetProperties

VString VNetAddress::GetProperties(const VString& inSep) const
{
	VString props;

	xbox_assert(IsV4() || IsV6());
	xbox_assert(!(IsV4() && IsV6()));

#if !VERSIONWIN
	if(!GetName().IsEmpty())
		props.AppendString(GetName()).AppendString(inSep);
#endif
	
	props.AppendCString(IsV4() ? "v4" : "");
	props.AppendCString(IsV6() ? "v6" : "");

	if(IsV4MappedV6())
		props.AppendString(inSep).AppendCString("v4 mapped v6");
	
	if(IsLoopBack())
		props.AppendString(inSep).AppendCString("loopback");
	
	if(IsAny())
		props.AppendString(inSep).AppendCString("any");
	
	if(IsAPIPA())
		props.AppendString(inSep).AppendCString("APIPA");
	
	if(IsULA())
		props.AppendString(inSep).AppendCString("ULA");
	
	if(IsLocal())
		props.AppendString(inSep).AppendCString("Local");
	
	if(IsLocallyAssigned())
		props.AppendString(inSep).AppendCString("LocallyAssigned");

	return props;
}
开发者ID:sanyaade-iot,项目名称:core-XToolbox,代码行数:38,代码来源:VNetAddr.cpp

示例4: logDocDump

static void _ExplainTTRFormat_V1()
{
	VString		doc;

	char		theTime[512] = {0};
	time_t now = ::time( NULL);
	::strftime( theTime, sizeof( theTime),"%Y-%m-%dT%H:%M:%S", localtime( &now));

	doc = "Text (Tab-Tab-Return) format version ";
	doc.AppendLong(kTTR_FORMAT_VERSION);
	doc.AppendCString("\r\r");

	// ===============================================
	doc += "--------------------------------------------------\r";
	doc += "General\r";
	doc += "--------------------------------------------------\r";
	doc.AppendPrintf("Every entry is quoted by square brackets. For example: [%d] for \"FlushFromLanguage\".\r", eCLEntryKind_FlushFromLanguage);
	doc.AppendPrintf("First entry in the log is the \"start\" entry (%d), it gives the current date-time.\r", eCLEntryKind_Start);
	doc += "Then, every other entry is followed by [tab] ellapsed second since log started [tab] Task ID {and optionnaly: [tab] other infos...}\r\r";
	doc += "For example, when the log starts, first line is something like:\r";
	doc.AppendPrintf("[%d]\t%s\t10\r", eCLEntryKind_Start, theTime);
	doc += "Then you may have (FlushFromLanguage, executed 5 seconds since the log started, for task ID 10):\r";
	doc.AppendPrintf("[%d]\t5\t10\r", eCLEntryKind_FlushFromLanguage);

	doc += "\rEntries may be quoted with start/end. In this case, the format is [entry num]s and [entry num]e.";
	doc += " Between both tags, several other entries may be logged, from the same task ID or from others.\r";
	doc += "In all cases, the 'end' tag is formatted: [entry num]e [tab] ellapsed second since log started [tab] taskID [tab] count of milliseconds since [entry num]start\r";
	doc += "For example, with the FlushFromLanguage kind launched from task ID 10, the log could be:\r";
	doc.AppendPrintf("[%d]s\t123\t10\t(...other infos - see format)\r", eCLEntryKind_FlushFromLanguage);
	doc += ". . .\r. . .\r. . .\r";
	doc.AppendPrintf("[%d]s\t126\t10\t(...other infos - see format)\r", eCLEntryKind_FlushFromLanguage);

	// ===============================================
	doc += "--------------------------------------------------\r";
	doc += "List of all kinds of entry (name [tab] value)\r";
	doc += "--------------------------------------------------\r";
	doc.AppendPrintf("Unknown\t%d\r", eCLEntryKind_Unknown);
	doc.AppendPrintf("Start\t%d\r", eCLEntryKind_Start);
	doc.AppendPrintf("Stop\t%d\r", eCLEntryKind_Stop);
	doc.AppendPrintf("Comment\t%d\r", eCLEntryKind_Comment);
	doc.AppendPrintf("NeedsBytes\t%d\r", eCLEntryKind_NeedsBytes);
	doc.AppendPrintf("CallNeedsBytes\t%d\r", eCLEntryKind_CallNeedsBytes);
	doc.AppendPrintf("FlushFromLanguage\t%d\r", eCLEntryKind_FlushFromLanguage);
	doc.AppendPrintf("FlushFromMenuCommand\t%d\r", eCLEntryKind_FlushFromMenuCommand);
	doc.AppendPrintf("FlushFromScheduler\t%d\r", eCLEntryKind_FlushFromScheduler);
	doc.AppendPrintf("FlushFromBackup\t%d\r", eCLEntryKind_FlushFromBackup);
	doc.AppendPrintf("FlushFromNeedsBytes\t%d\r", eCLEntryKind_FlushFromNeedsBytes);
	doc.AppendPrintf("FlushFromRemote\t%d\r", eCLEntryKind_FlushFromRemote);
	doc.AppendPrintf("FlushFromUnknown\t%d\r", eCLEntryKind_FlushFromUnknown);
	doc.AppendPrintf("Flush\t%d\r", eCLEntryKind_Flush);
	doc.AppendPrintf("MemStats\t%d\r", eCLEntryKind_MemStats);

	doc.AppendCString("\r\r");

	// ===============================================
	doc += "--------------------------------------------------\r";
	doc += "Format and meaning of each kind\r";
	doc += "--------------------------------------------------\r";

	doc.AppendPrintf("[%d]\r", eCLEntryKind_Unknown);
	doc += "Unknown entry kind\r";
	doc.AppendPrintf("[%d] [tab] ellapsed second since log started [tab] taskID\r\r", eCLEntryKind_Unknown);

	doc.AppendPrintf("[%d]\r", eCLEntryKind_Start);
	doc += "The log starts. Quoted (start/end) entry, with misc. infos between the start and the end.\r";
	doc.AppendPrintf("[%d]s [tab] current time [tab] taskID [tab] version [cr]\r", eCLEntryKind_Start);
	doc.AppendPrintf("struct [tab] path to host database structure file [cr]\r");
	doc.AppendPrintf("data [tab] path to host database data file [cr]\r");
	doc.AppendPrintf("[%d]e\r\r", eCLEntryKind_Start);

	doc.AppendPrintf("[%d]\r", eCLEntryKind_Stop);
	doc += "The log ends\r";
	doc.AppendPrintf("[%d] [tab] ellapsed second since log started [tab] taskID\r\r", eCLEntryKind_Stop);

	doc.AppendPrintf("[%d]\r", eCLEntryKind_Comment);
	doc += "A comment added by the developer. Comments are always quoted with start and end, a \\r is added at beginning and end.\r";
	doc.AppendPrintf("[%d]start [tab] ellapsed second since log started [tab] taskID [cr] the comment [cr] [%d]end [tab] time [tab] taskID [tab] 0 (the milliseconds)\r\r", eCLEntryKind_Comment);

	doc.AppendPrintf("[%d]\r", eCLEntryKind_NeedsBytes);
	doc += "Any source asks memory to the cache manager\r";
	doc.AppendPrintf("[%d] [tab] ellapsed second since log started [tab] taskID [tab] task name [tab] process 4D num [tab] needed bytes (very large int.)\r", eCLEntryKind_NeedsBytes);
	doc.AppendPrintf("Note: may be followed by [%d]\r\r", eCLEntryKind_MemStats);

	doc.AppendPrintf("[%d]\r", eCLEntryKind_CallNeedsBytes);
	doc += "Memory manager asks memory to the cache manager: not enough space in the cache to allocate memory. The cache manager will try to free unused objects, to flush, etc...\r";
	doc.AppendPrintf("[%d] [tab] ellapsed second since log started [tab] taskID [tab] task name [tab] process 4D num [tab] needed bytes (very large int.)\r", eCLEntryKind_CallNeedsBytes);
	doc.AppendPrintf("Note: may be followed by [%d]\r\r", eCLEntryKind_MemStats);

	doc.AppendPrintf("[%d], [%d], [%d], [%d], [%d], [%d], [%d]\r", eCLEntryKind_FlushFromLanguage,
																	eCLEntryKind_FlushFromMenuCommand,
																	eCLEntryKind_FlushFromScheduler,
																	eCLEntryKind_FlushFromBackup,
																	eCLEntryKind_FlushFromNeedsBytes,
																	eCLEntryKind_FlushFromRemote,
																	eCLEntryKind_FlushFromUnknown);
	doc += "Action at the origin of a flush. All the 'FlushFrom...' share the same format.\r";
	doc.AppendPrintf("[%d] [tab] ellapsed second since log started [tab] taskID [tab] task name [tab] process 4D num [tab] isWaitUntilDone (1 = yes, 0 = no, -1 = unknown) [tab] isEmptyCache (1 = yes, 0 = no, -1 = unknown)\r", eCLEntryKind_CallNeedsBytes);
	doc.AppendPrintf("Note: may be followed by [%d]\r", eCLEntryKind_MemStats);
	doc.AppendPrintf("Note: [%d] means a flush was requested from the remote, but we don't have the exact origin (does a client called FLUSH BUFFERS explicitely? ...)\r\r", eCLEntryKind_FlushFromRemote);

//.........这里部分代码省略.........
开发者ID:sanyaade-iot,项目名称:core-Components,代码行数:101,代码来源:VCacheLog.cpp


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