本文整理汇总了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 ();
}
示例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;
}