本文整理汇总了C++中WrapperStr::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ WrapperStr::insert方法的具体用法?C++ WrapperStr::insert怎么用?C++ WrapperStr::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WrapperStr
的用法示例。
在下文中一共展示了WrapperStr::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_one
//.........这里部分代码省略.........
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();
}
if (at->isVolatile() != volatilep) {
at->set_isVolatile(volatilep);
container->set_updated();
}
if (at->isClassMember() != staticp) {
at->set_isClassMember(staticp);
container->set_updated();
}
if (!array.isEmpty())
decl.insert(index + 7, "${multiplicity}");
if (neq(at->multiplicity(), array)) {
at->set_Multiplicity(array);
container->set_updated();
}
WrapperStr v = at->defaultValue();
if (!v.isEmpty() && (((const char *) v)[0] == '='))
v = v.mid(1);
if (nequal(v, value)) {
at->set_DefaultValue(value);
container->set_updated();
}
if (nequal(at->javaAnnotations(), annotation)) {
at->set_JavaAnnotations(annotation);
container->set_updated();
}
WrapperStr stereotype;
bool force_ste = FALSE;
if (cl->stereotype() == "enum") {
stereotype = "attribute";
force_ste = TRUE;
}
else if (typespec.type == 0) {
WrapperStr t = typespec.explicit_type;
int index2;
示例2: new_one
//.........这里部分代码省略.........
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)
decl.replace(index, decl.find("${name}") + 7 - index, type);
else {
if (!modifier.isEmpty())
decl.insert(index + 7, (const char *)(WrapperStr(" ") + modifier));
if (typeform != "${type}")
decl.replace(index, 7, typeform);
else if (typespec.type == 0) {
WrapperStr t = typespec.explicit_type;
int index2 = 0;
if (!t.isEmpty() && (t.at(t.length() - 1) == ">") && ((index2 = t.find('<')) > 0))
{
stereotype = t.left(index2);
typespec.explicit_type =
// may be a,b ...
t.mid(index2 + 1, t.length() - 2 - index2);
decl.replace(index, 7, "${stereotype}<${type}>");
}
}
if (!array.isEmpty())
decl.insert(decl.find("${name}") + 7, "${multiplicity}");
if (!bitfield.isEmpty())
decl.insert(decl.find(';'), (const char *)(WrapperStr(" : ") + bitfield));
}
if (typenamep) {
int index = decl.find("${const}") + 8; // find cannot return -1
int index2 = decl.find("${mutable}") + 10; // find cannot return -1
int index3 = decl.find("${volatile}") + 11; // find cannot return -1
if (index2 > index) index = index2;
if (index3 > index) index = index3;