本文整理汇总了C++中String::Copy方法的典型用法代码示例。如果您正苦于以下问题:C++ String::Copy方法的具体用法?C++ String::Copy怎么用?C++ String::Copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String::Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessToken
//.........这里部分代码省略.........
// Skip the appropriate number of lines
while (repeatCount--)
inputLine.ReadLine(input);
inputPos = 0;
// Separators are optional, so we might already be at the next field
if (format[formatPos] == ',' || format[formatPos] || ')')
FinishField();
return false;
}
// Check that we haven't encountered a rare, but unsupported input type
if (format[formatPos] == 'Q' || format[formatPos] == 'P' || format[formatPos] == 'B')
{
formatPos++;
int problemStart = formatPos;
while (format[formatPos] != ',' && format[formatPos] != ')' && format[formatPos] != '/')
formatPos++;
error("Unsupported pattern in FORMAT statement\n\n"
"Statement \"%s\" includes unsupporterd pattern '%s'\n",
(const char *) format,
(const char *) format.SubStr(problemStart, formatPos - problemStart));
}
if (format[formatPos] == ':')
{
formatPos++;
if (format[formatPos] == ',' || format[formatPos] || ')')
FinishField();
repeatCount = 0;
endOfPattern = true;
return false;
}
// All the other types we recognize include a width specifier
// Identify the location of the type specifier
int typeStart = formatPos;
while (CharacterFollows())
formatPos++;
int typeLen = formatPos - typeStart;
// Retrieve the field width
int width = GetIntegerFromFormat();
if (width == 0)
error("Unrecognized FORMAT statement\n\n"
"Statement \"%s\" is missing a width specifier for a field of type '%s'\n",
(const char *) format, (const char *) format.SubStr(typeStart, typeLen));
// Check for horizontal tab character
if (format[typeStart] == 'T')
{
// Move left by a specified number of characters
if (format[typeStart + 1] == 'L')
inputPos = width > inputPos ? 0 : inputPos - width;
// Move right by a specified number of characters
else if (format[typeStart + 1] == 'R')
inputPos += width;
// Or simply set the appropriate horizontal position
else
inputPos = width;
repeatCount--;
if (repeatCount)
formatPos = repeatPos;
else
FinishField();
return false;
}
// Assume that if we got here, we are looking at a data field!
field.Copy(inputLine, inputPos, width);
field.Trim();
inputPos += width;
repeatCount--;
if (repeatCount)
formatPos = repeatPos;
else
FinishField();
return true;
}
示例2: _LoadAsync
void BBDataBuffer::_LoadAsync( const String &cpath,BBThread *thread ){
String path=cpath.Copy();
if( _Load( path ) ) thread->SetResult( this );
}