本文整理汇总了C++中JString::GetLastCharacter方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::GetLastCharacter方法的具体用法?C++ JString::GetLastCharacter怎么用?C++ JString::GetLastCharacter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::GetLastCharacter方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
JBoolean
JSplitPathAndName
(
const JCharacter* fullName,
JString* path,
JString* name
)
{
assert( !JStringEmpty(fullName) );
JString pathAndName = fullName;
assert( pathAndName.GetLastCharacter() != ACE_DIRECTORY_SEPARATOR_CHAR );
JIndex i;
if (pathAndName.LocateLastSubstring(ACE_DIRECTORY_SEPARATOR_STR, &i))
{
*path = pathAndName.GetSubstring(1,i);
*name = pathAndName.GetSubstring(i+1, pathAndName.GetLength());
JCleanPath(path);
return kJTrue;
}
else
{
*path = JGetCurrentDirectory();
*name = pathAndName;
return kJFalse;
}
}
示例2: indexStr
JString
CMLink::Build1DArrayExpressionForCFamilyLanguage
(
const JCharacter* origExpr,
const JInteger index
)
{
JString expr = origExpr;
const JString indexStr(index, 0); // must use floating point conversion
if (expr.Contains("$i"))
{
const JCharacter* map[] =
{
"i", indexStr.GetCString()
};
(JGetStringManager())->Replace(&expr, map, sizeof(map));
}
else
{
if (expr.GetFirstCharacter() != '(' ||
expr.GetLastCharacter() != ')')
{
expr.PrependCharacter('(');
expr.AppendCharacter(')');
}
expr.AppendCharacter('[');
expr += indexStr;
expr.AppendCharacter(']');
}
return expr;
}
示例3:
void
SyGViewManPageDialog::SetFunction
(
const JCharacter* historyStr
)
{
JString fnName = historyStr;
JCharacter manIndex[] = { '\0', '\0' };
if (fnName.GetLastCharacter() == ')')
{
manIndex[0] = fnName.GetCharacter(fnName.GetLength()-1);
fnName.RemoveSubstring(fnName.GetLength()-3, fnName.GetLength());
}
if (manIndex[0] == '*')
{
manIndex[0] = '\0';
itsAproposCheckbox->SetState(kJTrue);
}
else
{
itsAproposCheckbox->SetState(kJFalse);
}
itsFnName->SetText(fnName);
itsManIndex->SetText(manIndex);
}
示例4: JReadUntilws
GVarList::GVarList
(
istream& input
)
:
JVariableList()
{
GVarListX();
input >> ws;
while (input.peek() != '*')
{
JCharacter type;
input >> type >> ws;
if (type == 'N')
{
JString name = JReadUntilws(input);
if (name.GetLastCharacter() != ']')
{
JFloat value;
input >> value;
AddVariable(name, value);
}
else
{
示例5:
JBoolean
GAddressBookMgr::NameIsAlias
(
const JCharacter* name,
JString& alias,
JString& fcc
)
{
GAddressBookEntry* entry;
if (!itsAddresses->GetElement(name, &entry))
{
return kJFalse;
}
alias = entry->address;
if (alias.IsEmpty())
{
return kJFalse;
}
if (alias.GetFirstCharacter() == '(' &&
alias.GetLastCharacter() == ')')
{
if (entry->address.GetLength() > 2)
{
alias = entry->address.GetSubstring(2, entry->address.GetLength() - 1);
}
}
fcc = entry->fcc;
if (!fcc.IsEmpty() &&
fcc.GetFirstCharacter() == '(' &&
fcc.GetLastCharacter() == ')')
{
if (entry->fcc.GetLength() > 2)
{
fcc = entry->fcc.GetSubstring(2, entry->fcc.GetLength() - 1);
}
}
return kJTrue;
}
示例6: iStr
JString
CMLink::Build2DArrayExpressionForCFamilyLanguage
(
const JCharacter* origExpr,
const JInteger rowIndex,
const JInteger colIndex
)
{
JString expr = origExpr;
const JBoolean usesI = expr.Contains("$i"); // row
const JBoolean usesJ = expr.Contains("$j"); // col
const JString iStr(rowIndex, 0); // must use floating point conversion
const JString jStr(colIndex, 0); // must use floating point conversion
// We have to do both at the same time because otherwise we lose a $.
if (usesI || usesJ)
{
const JCharacter* map[] =
{
"i", iStr.GetCString(),
"j", jStr.GetCString()
};
(JGetStringManager())->Replace(&expr, map, sizeof(map));
}
if (!usesI || !usesJ)
{
if (expr.GetFirstCharacter() != '(' ||
expr.GetLastCharacter() != ')')
{
expr.PrependCharacter('(');
expr.AppendCharacter(')');
}
if (!usesI)
{
expr.AppendCharacter('[');
expr += iStr;
expr.AppendCharacter(']');
}
if (!usesJ)
{
expr.AppendCharacter('[');
expr += jStr;
expr.AppendCharacter(']');
}
}
return expr;
}
示例7:
JVIKeyHandler::CutBuffer*
JVIKeyHandler::GetCutBuffer
(
const JRegex& r,
const JArray<JIndexRange>& matchList
)
const
{
JString s;
if (r.GetSubexpression(itsKeyBuffer, "cutbuf", matchList, &s))
{
return theNamedCutBuffer + s.GetLastCharacter() - kNamedCutBufferOffset;
}
else
{
return &theCutBuffer;
}
}
示例8: iStr
JString
XDLink::Build2DArrayExpression
(
const JCharacter* origExpr,
const JInteger rowIndex,
const JInteger colIndex
)
{
JString expr = origExpr;
const JBoolean usesI = expr.Contains("$i"); // row
const JBoolean usesJ = expr.Contains("$j"); // col
const JString iStr(rowIndex, 0); // must use floating point conversion
const JString jStr(colIndex, 0); // must use floating point conversion
// We have to do both at the same time because otherwise we lose a $.
if (usesI || usesJ)
{
// double literal $'s
for (JIndex i=expr.GetLength()-1; i>=1; i--)
{
if (expr.GetCharacter(i) == '$' &&
expr.GetCharacter(i+1) != 'i' &&
expr.GetCharacter(i+1) != 'j')
{
expr.InsertCharacter('$', i);
}
}
const JCharacter* map[] =
{
"i", iStr.GetCString(),
"j", jStr.GetCString()
};
(JGetStringManager())->Replace(&expr, map, sizeof(map));
}
if (!usesI || !usesJ)
{
if (expr.GetFirstCharacter() != '(' ||
expr.GetLastCharacter() != ')')
{
expr.PrependCharacter('(');
expr.AppendCharacter(')');
}
if (!usesI)
{
expr.AppendCharacter('[');
expr += iStr;
expr.AppendCharacter(']');
}
if (!usesJ)
{
expr.AppendCharacter('[');
expr += jStr;
expr.AppendCharacter(']');
}
}
return expr;
}
示例9: JCalcMatchLength
JString
JConvertToRelativePath
(
const JCharacter* origPath,
const JCharacter* origBase
)
{
// Check that they are both absolute paths.
assert( origPath != NULL && origPath[0] == '/' &&
origBase != NULL && origBase[0] == '/' );
// Remove extra directory separators
// and make sure that base ends with one.
JString path = origPath;
JCleanPath(&path);
JString base = origBase;
JCleanPath(&base);
JAppendDirSeparator(&base);
// Find and remove the matching directories at the beginning.
// The while loop backs us up so we only consider complete directory names.
JBoolean hadTDS = kJTrue;
if (path.GetLastCharacter() != '/')
{
path.AppendCharacter('/');
hadTDS = kJFalse;
}
JSize matchLength = JCalcMatchLength(path, base);
if (!hadTDS)
{
path.RemoveSubstring(path.GetLength(), path.GetLength());
}
while (base.GetCharacter(matchLength) != '/')
{
matchLength--;
}
assert( matchLength >= 1 );
if (matchLength == 1)
{
return path;
}
if (matchLength > path.GetLength())
{
base.RemoveSubstring(matchLength, matchLength);
matchLength--;
}
path.RemoveSubstring(1, matchLength);
base.RemoveSubstring(1, matchLength);
if (base.IsEmpty())
{
path.Prepend("./");
return path;
}
// The number of remaining directory separators in base
// is the number of levels to go up.
JSize upCount = 0;
const JSize baseLength = base.GetLength();
for (JIndex i=1; i<=baseLength; i++)
{
if (base.GetCharacter(i) == '/')
{
upCount++;
path.Prepend("../");
}
}
assert( upCount > 0 );
return path;
}
示例10: frame
//.........这里部分代码省略.........
RemoveIdentifier(kObjLabelMarker, &label);
// shortcuts
JString shortcuts = JReadLine(input);
RemoveIdentifier(kObjShortcutMarker, &shortcuts);
optionValues.SetElement(kShortcutsIndex, &shortcuts, JPtrArrayT::kForget);
// resizing (ignored)
JIgnoreLine(input);
// gravity
input >> ws;
line = JReadUntilws(input);
assert( line == kObjGravityMarker );
const JString nwGravity = JReadUntilws(input);
const JString seGravity = JReadUntilws(input);
// variable name
JBoolean isLocal = kJFalse;
JString* varName = new JString(JReadLine(input));
assert( varName != NULL );
RemoveIdentifier(kObjNameMarker, varName);
if (varName->IsEmpty())
{
isInstanceVar.AppendElement(kJFalse);
GetTempVarName(tagName, varName, *objNames);
isLocal = kJTrue;
}
else if (varName->GetFirstCharacter() == '(' &&
varName->GetLastCharacter() == ')')
{
isInstanceVar.AppendElement(kJFalse);
isLocal = kJTrue;
*varName = varName->GetSubstring(2, varName->GetLength()-1);
}
else if (varName->GetFirstCharacter() == '<' &&
varName->GetLastCharacter() == '>')
{
isInstanceVar.AppendElement(kJFalse);
*varName = varName->GetSubstring(2, varName->GetLength()-1);
}
else
{
isInstanceVar.AppendElement(kJTrue);
}
objNames->Append(varName);
// callback (ignored)
JIgnoreLine(input);
// callback argument
JString cbArg = JReadLine(input);
RemoveIdentifier(kObjCBArgMarker, &cbArg);
JString cbArgExtra;
do
{
cbArgExtra = JReadLine(input);
cbArgExtra.TrimWhitespace();
}