本文整理汇总了C++中WrapperStr::at方法的典型用法代码示例。如果您正苦于以下问题:C++ WrapperStr::at方法的具体用法?C++ WrapperStr::at怎么用?C++ WrapperStr::at使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WrapperStr
的用法示例。
在下文中一共展示了WrapperStr::at方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
void UmlClass::write(QTextStream & f, const UmlTypeSpec & t,
bool with_formals, BooL * is_template)
{
if (t.type != 0)
t.type->write(f, with_formals, is_template);
else {
WrapperStr s = CppSettings::type(t.explicit_type);
f << s;
if (is_template != 0)
*is_template = (!s.isEmpty() && (s.at(s.length() - 1) == QString('>')));
}
}
示例2: legalName
WrapperStr UmlItem::legalName(WrapperStr s)
{
unsigned index;
unsigned n = s.length();
for (index = 0; index != n; index += 1) {
char c = s.at(index);
if (!(((c >= 'a') && (c <= 'z')) ||
((c >= 'A') && (c <= 'Z')) ||
((c >= '0') && (c <= '9')) ||
(c == '_')))
s.replace(index, 1, "_");
}
return s;
}
示例3: decl
WrapperStr UmlClass::decl()
{
WrapperStr result;
WrapperStr close_template;
UmlArtifact * cp = associatedArtifact();
WrapperStr nasp = ((UmlPackage *)
((cp != 0) ? (UmlItem *) cp : (UmlItem *) this)->package())
->cppNamespace();
if (!nasp.isEmpty()) {
int index =
// bypass :: allowing ::a...
((nasp.at(0) == ":") && (nasp != QString("::"))) ? 2 : 0;
int index2 = 0;
while ((index2 = nasp.find("::", index)) != -1) {
result += "namespace " + nasp.mid(index, index2 - index) + " { ";
close_template += " } ";
index = index2 + 2;
}
result += "namespace " + nasp.mid(index) + " { ";
close_template += " } ";
}
WrapperStr template1;
WrapperStr template2;
get_template_prefixes(template1, template2);
if (!template1.isEmpty())
result += template1.left(template1.length() - 1) + ' ';
result += cpp_stereotype() + ' ';
return result + name() + ';' + close_template + '\n';
}
示例4: new_one
bool UmlAttribute::new_one(Class * container, const WrapperStr & name,
UmlTypeSpec typespec, aVisibility visibility,
bool staticp, bool finalp, bool transientp,
bool volatilep, const WrapperStr & array,
const WrapperStr & value, WrapperStr comment,
WrapperStr description, WrapperStr annotation
#ifdef ROUNDTRIP
, bool roundtrip, QList<UmlItem *> & expected_order
#endif
)
{
#ifdef TRACE
QLOG_INFO() << "ATTRIBUTE '" << name << "'\n";
#endif
if (
#ifdef REVERSE
container->from_libp() && (
#endif
visibility == PrivateVisibility
#ifdef REVERSE
)
#endif
)
{
Lex::finish_line();
Lex::clear_comments();
return TRUE;
}
UmlClass * cl = container->get_uml();
UmlAttribute * at;
#ifdef ROUNDTRIP
bool created;
if (!roundtrip ||
((at = search_attr(container, name)) == 0)) {
#endif
at = UmlBaseAttribute::create(cl, name);
if (at == 0) {
JavaCatWindow::trace(WrapperStr("<font face=helvetica><b>cannot add attribute <i>")
+ name + "</i> in <i>" + cl->name()
+ "</i></b></font><br>");
return FALSE;
}
#ifdef REVERSE
# ifndef ROUNDTRIP
Statistic::one_attribute_more();
# else
if (roundtrip)
container->set_updated();
created = TRUE;
}
else
created = FALSE;
# endif
#endif
Lex::finish_line();
comment = Lex::get_comments(comment);
description = Lex::get_description(description);
WrapperStr decl = JavaSettings::attributeDecl("");
int index = decl.find("${type}");
if ((index == -1) || (decl.find("${name}") == -1)) {
decl = " ${comment}${@}${visibility}${static}${final}${transient}${volatile}${type} ${name}${value};";
index = decl.find("${type}");
}
#ifdef ROUNDTRIP
if (roundtrip && !created) {
if (decl.find("${description}") != -1) {
if (nequal(at->description(), description)) {
at->set_Description(description);
container->set_updated();
}
}
else if (nequal(at->description(), Lex::simplify_comment(comment))) {
at->set_Description(comment); // comment was set
container->set_updated();
}
if (at->isReadOnly() != finalp) {
at->set_isReadOnly(finalp);
container->set_updated();
}
if (at->isJavaTransient() != transientp) {
at->set_isJavaTransient(transientp);
container->set_updated();
}
//.........这里部分代码省略.........
示例5: new_one
bool UmlAttribute::new_one(Class * container, const WrapperStr & name,
const WrapperStr & type, const WrapperStr & modifier,
const WrapperStr & pretype, const WrapperStr & array,
aVisibility visibility, bool staticp, bool constp,
bool typenamep, bool mutablep, bool volatilep,
const WrapperStr & bitfield, const WrapperStr & value,
WrapperStr comment, WrapperStr description
#ifdef ROUNDTRIP
, bool roundtrip, QList<UmlItem *> & expected_order
#endif
)
{
#ifdef DEBUG_DOUML
QLOG_INFO() << "ATTRIBUTE '" << name << "' type '" << type << "' modifier '" << modifier << "' array '" << array << "'\n";
#endif
if (
#ifdef REVERSE
container->from_libp() &&
#endif
(visibility == PrivateVisibility)) {
Lex::finish_line();
Lex::clear_comments();
return TRUE;
}
UmlClass * cl = container->get_uml();
UmlAttribute * at;
#ifdef ROUNDTRIP
bool created;
if (!roundtrip ||
((at = search_attr(cl, name)) == 0)) {
#endif
at = UmlBaseAttribute::create(cl, name);
if (at == 0) {
UmlCom::trace(WrapperStr("<font face=helvetica><b>cannot add attribute <i>")
+ name + "</i> in <i>" + WrapperStr(cl->name())
+ "</i></b></font><br><hr>");
return FALSE;
}
#ifdef REVERSE
# ifndef ROUNDTRIP
Statistic::one_attribute_more();
# else
if (roundtrip)
container->set_updated();
created = TRUE;
}
else
created = FALSE;
# endif
#endif
Lex::finish_line();
comment = Lex::get_comments(comment);
description = Lex::get_description(description);
bool pfunc = (type.find('$') != -1);
UmlTypeSpec typespec;
WrapperStr typeform;
WrapperStr stereotype;
if (! pfunc) {
typeform = (pretype.isEmpty())
? WrapperStr("${type}")
: pretype + " ${type}";
container->compute_type(type, typespec, typeform);
}
else {
typespec.explicit_type = type.simplifyWhiteSpace();
int index = typespec.explicit_type.find("${name}");
if (index != -1)
typespec.explicit_type.remove(index, 7);
}
WrapperStr decl = CppSettings::attributeDecl("");
int index = decl.find("${type}");
if ((index == -1) ||
(decl.find("${const}") == -1) ||
(decl.find("${name}") == -1) ||
(decl.find("${mutable}") == -1) ||
(decl.find("${volatile}") == -1) ||
(decl.find(';') == -1)) {
decl = " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};";
index = decl.find("${type}");
}
if (pfunc)
//.........这里部分代码省略.........