本文整理汇总了C++中JString::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::Append方法的具体用法?C++ JString::Append怎么用?C++ JString::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::Append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
JString
JCombineRootAndSuffix
(
const JCharacter* root,
const JCharacter* suffix
)
{
JString name = root;
if (suffix[0] != '.')
{
name.AppendCharacter('.');
}
name.Append(suffix);
return name;
}
示例2: if
JString
JXFontManager::BuildFontName
(
const JCharacter* xName,
const JCharacter* charSet,
const JSize size,
const JFontStyle& style,
const JCharacter* italicStr,
const JBoolean iso
)
const
{
#ifdef _J_USE_XFT
JString xFontName;
return xFontName;
#else
// handle NxM separately
nxmRegex.SetMatchOnly(kJTrue);
if (nxmRegex.Match(xName))
{
JString xFontName = xName;
if (style.bold)
{
xFontName += "bold";
}
return xFontName;
}
// any foundry
JString xFontName = "-*-";
// given name
xFontName.Append(xName);
// regular or boldface
if (style.bold)
{
xFontName.Append("-bold");
}
else
{
xFontName.Append("-medium");
}
// regular or italic
if (style.italic)
{
xFontName.Append(italicStr);
}
else
{
xFontName.Append("-r");
}
// normal character spacing, any pixel size
xFontName.Append("-normal-*-*-");
// font size
xFontName.Append( JString(10*size, 0, JString::kForceNoExponent) );
// screen resolution (apparently, we should always just use 75 dpi fonts),
// any spacing, any avg width
xFontName.Append("-75-75-*-*-");
JIndex latinIndex;
if (!JStringEmpty(charSet))
{
xFontName.Append(charSet);
}
else if (iso && JXGetLatinCharacterSetIndex(&latinIndex))
{
JString s = "iso8859-";
s += JString(latinIndex, 0);
xFontName.Append(s);
}
else if (iso)
{
xFontName.Append("iso*-*");
}
else
{
xFontName.Append("*-*");
}
// return the result
return xFontName;
#endif
}
示例3: JString
JString
JXFontManager::BuildStdFontName
(
const JCharacter* xName,
const JSize size,
const JFontStyle& style,
const JCharacter* italicStr,
const JCharacter* iso
)
const
{
// handle NxM separately
if (nxmRegex.Match(xName))
{
JString xFontStr = xName;
if (style.bold)
{
xFontStr += "bold";
}
return xFontStr;
}
// any foundry
JString xFontStr = "-*-";
// given name
xFontStr.Append(xName);
// regular or boldface
if (style.bold)
{
xFontStr.Append("-bold");
}
else
{
xFontStr.Append("-medium");
}
// regular or italic
if (style.italic)
{
xFontStr.Append(italicStr);
}
else
{
xFontStr.Append("-r");
}
// normal character spacing, any pixel size
xFontStr.Append("-normal-*-*-");
// font size
xFontStr.Append( JString(10*(size+2), JString::kBase10) );
// screen resolution (apparently, we should always just use 75 dpi fonts),
// any spacing, any avg width, charset to match unicode
xFontStr.Append("-75-75-*-*-");
xFontStr.Append(iso);
// return the result
return xFontStr;
}
示例4: input
void
LLDBGetAssembly::HandleSuccess
(
const JString& cmdData
)
{
LLDBLink* link = dynamic_cast<LLDBLink*>(CMGetLink());
if (link == NULL)
{
return;
}
lldb::SBCommandInterpreter interp = link->GetDebugger()->GetCommandInterpreter();
if (!interp.IsValid())
{
return;
}
const CMLocation& loc = (GetDirector())->GetDisassemblyLocation();
const JString cmd = "disassemble -n " + JPrepArgForExec(loc.GetFunctionName());
lldb::SBCommandReturnObject result;
interp.HandleCommand(cmd, result);
JPtrArray<JString> addrList(JPtrArrayT::kDeleteAll);
JString instText;
if (result.IsValid() && result.Succeeded() && result.HasResult())
{
std::istringstream input(result.GetOutput());
JString line, s;
JSize maxOffsetLength = 0;
while (!input.eof() && !input.fail())
{
line = JReadLine(input);
JIndex i;
if (line.LocateSubstring(":", &i) && i < line.GetLength())
{
s = line.GetSubstring(1, i-1);
if (s.BeginsWith("->") && s.GetLength() > 2)
{
s = s.GetSubstring(3, s.GetLength());
}
s.TrimWhitespace();
addrList.Append(s);
JIndexRange r;
if (offsetPattern.Match(s, &r))
{
maxOffsetLength = JMax(maxOffsetLength, r.GetLength());
}
if (!instText.IsEmpty())
{
instText.AppendCharacter('\n');
}
s = line.GetSubstring(i+1, line.GetLength());
s.TrimWhitespace();
instText.Append(s);
}
}
const JSize count = addrList.GetElementCount();
for (JIndex i=1; i<count; i++)
{
JString* s = addrList.NthElement(i);
JIndexRange r;
if (offsetPattern.Match(*s, &r))
{
const JSize pad = maxOffsetLength - r.GetLength();
for (JIndex j=0; j<pad; j++)
{
s->InsertCharacter('0', r.first+2);
}
}
}
}
(GetDirector())->DisplayDisassembly(&addrList, instText);
}
示例5: names
void
SMTPMessage::HandleAddresses()
{
JPtrArray<JString> names(JPtrArrayT::kForgetAll);
GParseNameList(*itsTo, names);
ReplaceAliases(names);
while (!names.IsEmpty())
{
JString* str = names.GetFirstElement();
if (!str->BeginsWith("<"))
{
str->Prepend("<");
str->Append(">");
}
if (itsToNames->InsertSorted(str,kJFalse))
{
names.RemoveElement(1);
}
else
{
names.DeleteElement(1);
}
}
GParseNameList(*itsCC, names);
ReplaceAliases(names);
while (!names.IsEmpty())
{
JString* str = names.GetFirstElement();
if (!str->BeginsWith("<"))
{
str->Prepend("<");
str->Append(">");
}
JIndex findex;
if (itsToNames->SearchSorted(str, JOrderedSetT::kFirstMatch, &findex))
{
names.DeleteElement(1);
}
else
{
if (itsCcNames->InsertSorted(str,kJFalse))
{
names.RemoveElement(1);
}
else
{
names.DeleteElement(1);
}
}
}
GParseNameList(*itsBCC, names);
ReplaceAliases(names);
while (!names.IsEmpty())
{
JString* str = names.GetFirstElement();
if (!str->BeginsWith("<"))
{
str->Prepend("<");
str->Append(">");
}
JIndex findex;
if (itsToNames->SearchSorted(str, JOrderedSetT::kFirstMatch, &findex))
{
names.DeleteElement(1);
}
else
{
if (itsCcNames->SearchSorted(str, JOrderedSetT::kFirstMatch, &findex))
{
names.DeleteElement(1);
}
else
{
if (itsBccNames->InsertSorted(str,kJFalse))
{
names.RemoveElement(1);
}
else
{
names.DeleteElement(1);
}
}
}
}
}