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


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

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


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

示例1: Export

	//000502 new function to return string of all items
	VString Export ()
	{
		//BEEP;
		
		VLinkedListStringItem* pItem = GetFirstItem();
		VString	sOut;

		while ( pItem )
		{
			sOut.Append (pItem->String());

			//070830 this sub is for building an Export TT. we no longer want the
			//		trailing \t, too hard to read and TT parses OK without it
			//sOut.Append ("\t-\t\n,");	//000601 for Export TT. 041101 added hyphen
			sOut.Append ("\t-\n,");

			pItem = pItem->GetNextItem();
		}
		
		return sOut.String ();
	}
开发者ID:OCLC-Developer-Network,项目名称:MARCView-Convert,代码行数:22,代码来源:vsortedstringlinkedlist.hpp

示例2: s

	/** Register an applications file extension and type with the system. To
	remove them during un-install, call RemoveOpenCommand().
	pszDotFileExtension is the file extension used when the system should
	launch your application when the user clicks on a file of your type.
	This must include the leading period. For instance, if your application
	deals with TXT files, pass .TXT for pszDotFileExtension. pszFileType is
	the name of the file association the system displays for the
	pszDotFileExtension type. For TXT, the system displays "Text File". You
	can customize what the user see's with pszFileType. Returns VTRUE on
	success, VFALSE on failure.*/
	static VBOOL	OpenCommand(	VSTRING_CONST	pszDotFileExtension,
									VSTRING_CONST	pszFileType,
									HINSTANCE		hAltModuleHandle = NULL)
	{
		/* These must be known!*/
		VASSERT(VSTRLEN_CHECK(pszDotFileExtension))
		VASSERT(VSTRLEN_CHECK(pszFileType))

		/* Must start with period.*/
		VASSERT(*pszDotFileExtension == '.')

		VBOOL bSuccess = VFALSE;

		VRegistry reg;

		if ( reg.CreateKey(pszDotFileExtension, HKEY_CLASSES_ROOT) )
		{
			reg.WriteString((VSTRING_CONST)NULL, pszFileType);
			reg.Close();

			/* Set the file type so Explorer can display this instead
			of just "xxx file".*/
			if ( reg.CreateKey(pszFileType, HKEY_CLASSES_ROOT) )
			{
				reg.WriteString((VSTRING_CONST)NULL, pszFileType);

				/* Create the default icon key.*/
				VRegistry regDefaultIcon;

				if ( regDefaultIcon.CreateKey(	VTEXT("DefaultIcon"),
												reg.GetKey()) )
				{
					/* Get module path and append ,0 to it.*/
					VString s;

					if (	s.GetModulePath(VFALSE, VFALSE, hAltModuleHandle) &&
							s.Append(VTEXT(",0")) )
					{
						regDefaultIcon.WriteString((VSTRING_CONST)NULL, s);
						regDefaultIcon.Close();
					}
				}

				/* Create the command key.*/
				VRegistry regCommand;

				if (	regCommand.CreateKey(
							VSHELLREGISTRAR_STRING_SHELL_OPEN_COMMAND,
							reg.GetKey()) )
				{
					reg.Close();

					/* Get module path. Filename must be in quotes for
					long filenames to work.*/
					VString s(VTEXT("\""));

					if (	s.GetModulePathAppend(	VFALSE,
													VFALSE,
													hAltModuleHandle) &&
							s.Append(VTEXT("\" \"%1\"")) )
					{
						/* Write this key.*/
						regCommand.WriteString((VSTRING_CONST)NULL, s);

						/* Success!*/
						bSuccess = VTRUE;
					}
				}
			}
		}

		return bSuccess;
	}
开发者ID:OCLC-Developer-Network,项目名称:MARCView-Convert,代码行数:83,代码来源:vshellregistrar.hpp


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