本文整理汇总了C++中WrapperStr类的典型用法代码示例。如果您正苦于以下问题:C++ WrapperStr类的具体用法?C++ WrapperStr怎么用?C++ WrapperStr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WrapperStr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: inState
void UmlActivityObject::write_in_state(FileOut & out)
{
WrapperStr s = inState();
if (!s.isEmpty()) {
UmlState * st = UmlState::find(s);
if (st != 0)
out.ref(st, "inState");
else {
// not legal but ...
out << " inState=\"";
out.quote(s);
out << '"';
}
}
}
开发者ID:DoUML,项目名称:douml,代码行数:17,代码来源:UmlActivityObject.cpp
示例2: while
void UmlItem::importDependency(FileIn & in, Token & token, UmlItem * where)
{
WrapperStr client = token.valueOf("client");
WrapperStr supplier = token.valueOf("supplier");
WrapperStr label = token.valueOf("name");
WrapperStr constraint;
int kind = (token.xmiType() == "uml:Usage") ? 3 : 1;
if (! token.closed()) {
WrapperStr k = token.what();
const char * kstr = k;
while (in.read(), !token.close(kstr)) {
WrapperStr s = token.what();
if (s == "client")
client = token.xmiIdref();
else if (s == "supplier")
supplier = token.xmiIdref();
else if (s == "ownedrule") {
constraint = UmlItem::readConstraint(in, token);
continue;
}
if (! token.closed())
in.finish(s);
}
}
if (client.isEmpty())
in.warning("'client' is missing");
else {
if (supplier.isEmpty())
// Borland Together 2006 for Eclipse
supplier = where->id();
QMap<QString, UmlItem *>::ConstIterator from = All.find(client);
QMap<QString, UmlItem *>::ConstIterator to = All.find(supplier);
if ((from != All.end()) && (to != All.end()))
(*from)->generalizeDependRealize(*to, in, kind, label, constraint);
else
UnresolvedRelation::add(kind, client, supplier, label, constraint);
}
}
开发者ID:daniel7solis,项目名称:douml,代码行数:45,代码来源:UmlItem.cpp
示例3: create
void UmlReplyAction::importIt(FileIn & in, Token & token, UmlItem * where)
{
where = where->container(aReplyAction, token, in);
if (where != 0) {
WrapperStr s = token.valueOf("name");
UmlReplyAction * a = create(where, s);
if (a == 0)
in.error("cannot create reply action '"
+ s + "' in '" + where->name() + "'");
a->addItem(token.xmiId(), in);
if (!(s = token.valueOf("trigger")).isEmpty()) {
WrapperStr tr = Trigger::get(s);
if (!tr.isNull())
a->set_ReplyToCall(tr);
else
Unresolved::addRef(a, s);
}
if (! token.closed()) {
WrapperStr k = token.what();
const char * kstr = k;
while (in.read(), !token.close(kstr)) {
if (token.what() == "trigger") {
WrapperStr tr_name;
WrapperStr tr_ref;
Trigger::add(in, token, tr_name, tr_ref);
if (!tr_name.isNull())
a->set_ReplyToCall(tr_name);
else
Unresolved::addRef(a, tr_ref);
}
else
a->import(in, token);
}
}
}
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:45,代码来源:UmlActivityActionClasses.cpp
示例4: formals
bool UmlClass::is_itself(WrapperStr t)
{
// class is a template class and t is x<...> where x is the class,
// t is normalized
// return true if t is the class with its formals
int index = t.find('<');
t = t.mid(index + 1, t.length() - index - 2);
QList<UmlFormalParameter> l = formals();
QList<UmlFormalParameter>::ConstIterator it = l.begin();
WrapperStr t2 = (*it).name();
while ((++it) != l.end())
t2 += ',' + (*it).name();
return (t == t2);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:18,代码来源:UmlClass.cpp
示例5: setType
bool UmlItem::setType(WrapperStr idref, int context, UmlTypeSpec & type)
{
if (idref.isEmpty())
return FALSE;
else if (getType(idref, type))
return TRUE;
else {
UnresolvedWithContext::add(this, idref, context);
return FALSE;
}
}
开发者ID:daniel7solis,项目名称:douml,代码行数:11,代码来源:UmlItem.cpp
示例6: type
WrapperStr IdlSettings::type(WrapperStr s)
{
if (s.isEmpty())
return s;
read_if_needed_();
UmlBuiltin * b = UmlSettings::_map_builtins.find(s);
return (b) ? b->idl : s;
}
开发者ID:harmegnies,项目名称:douml,代码行数:11,代码来源:IdlSettings.cpp
示例7: neq
bool neq(const WrapperStr & s1, const WrapperStr & s2)
{
const char * p1 = (s1.isNull()) ? "" : (const char *) s1;
const char * p2 = (s2.isNull()) ? "" : (const char *) s2;
for (;;) {
while (*p1 == '\r') p1 += 1;
while (*p2 == '\r') p2 += 1;
if (*p1 == 0)
return (*p2 != 0);
if (*p1 != *p2)
return true;
p1 += 1;
p2 += 1;
}
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:20,代码来源:mystr.cpp
示例8: type
WrapperStr JavaSettings::type(const WrapperStr & s)
{
if (s.isEmpty())
return s;
read_if_needed_();
UmlBuiltin * b = UmlSettings::_map_builtins.value(s);
return (b) ? b->java : s;
}
开发者ID:gilbertoca,项目名称:douml,代码行数:11,代码来源:JavaSettings.cpp
示例9: read
void FileIn::finish(WrapperStr what)
{
for (;;) {
Token & tk = read(TRUE);
if (tk.close(what))
return;
else if (tk.close())
error("'</" + tk.what() + ">' while wait for '</" + what + ">'");
else {
WrapperStr s = tk.xmiId();
if (! s.isEmpty())
BypassedIds.insert(s);
if (! tk.closed())
finish(tk.what());
}
}
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:20,代码来源:FileIn.cpp
示例10: type
WrapperStr CppSettings::type(WrapperStr s)
{
if (s.isEmpty())
return s;
read_if_needed_();
UmlBuiltin * b = UmlSettings::_map_builtins.value(s);
return (b) ? b->cpp : s;
}
开发者ID:gilbertoca,项目名称:douml,代码行数:11,代码来源:CppSettings.cpp
示例11: force_final_slash
static WrapperStr force_final_slash(WrapperStr p)
{
int ln = p.length();
if (ln < 2)
return p;
return (p[ln - 1] != '/')
? WrapperStr(p + '/')
: p;
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:11,代码来源:Package.cpp
示例12: while
void UmlItem::replace_alias(WrapperStr & s)
{
int index = 0;
while ((index = s.find("@{", index)) != -1) {
int index2 = s.find('}', index + 2);
if (index2 == -1)
return;
UmlBaseItem * obj = this;
WrapperStr key = s.mid(index + 2, index2 - index - 2);
WrapperStr value;
for (;;) {
if (obj->propertyValue(key, value)) {
s.replace(index, index2 - index + 1, value);
index += value.length();
break;
}
else if ((obj = obj->parent()) == 0) {
index = index2 + 1;
break;
}
}
}
}
开发者ID:javrillon,项目名称:douml,代码行数:27,代码来源:UmlItem.cpp
示例13: solveGeneralizationDependencyRealization
void UmlClass::solveGeneralizationDependencyRealization(int context, WrapperStr idref, WrapperStr label, WrapperStr constraint)
{
QMap<QString, UmlItem *>::Iterator it = All.find(idref);
if (it != All.end()) {
static const struct {
aRelationKind rk;
const char * err;
} r[] = {
{ aGeneralisation, "cannot create generalization from '" },
{ aDependency, "cannot create dependency from '" },
{ aRealization, "cannot create realization from '" },
{ aDependency, "cannot create usage from '" },
{ aDependency, "cannot create import from '" }
};
UmlItem * target = *it;
UmlItem * rel;
if (target->kind() == aClass)
rel = UmlRelation::create(r[context].rk, this, (UmlClass *) target);
else
rel = UmlNcRelation::create(r[context].rk, this, target);
if (rel == 0)
UmlCom::trace(r[context].err + name() + "' to '" + target->name() + "'<br>");
else {
if (!label.isEmpty())
rel->set_Name(label);
if (!constraint.isEmpty() && (target->kind() == aClass))
((UmlRelation *) rel)->set_Constraint(constraint);
if (context == 3)
rel->set_Stereotype("use");
}
}
else if (!FileIn::isBypassedId(idref))
UmlCom::trace("relation : unknown target reference '" + idref + "'<br>");
}
开发者ID:daniel7solis,项目名称:douml,代码行数:39,代码来源:UmlClass.cpp
示例14: setOrdering
void UmlActivityObject::setOrdering(WrapperStr s, FileIn & in)
{
if (s == "unordered")
set_Ordering(unordered);
else if (s == "ordered")
set_Ordering(ordered);
else if (s == "LIFO")
set_Ordering(lifo);
else if (s == "FIFO")
set_Ordering(fifo);
else if (! s.isEmpty())
in.warning("wrong ordering '" + s + "'");
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:13,代码来源:UmlActivityObject.cpp
示例15: source_path
WrapperStr UmlPackage::header_path(const WrapperStr & f, WrapperStr relto)
{
if (!dir.read) {
source_path(f);
if (dir.h.isEmpty()) {
UmlCom::trace(WrapperStr("<font color=\"red\"><b><b> The generation directory "
"must be specified for the package<i> ") + name()
+ "</i>, edit the <i> generation settings</i> (tab 'directory') "
"or edit the package (tab 'C++')</b></font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("UmlPackage::source_path");
}
if (QDir::isRelativePath(dir.h)) {
UmlCom::trace(WrapperStr("<font color=\"red\"><b><i>")
+ name() + "</i>'s header path <i>(" + dir.h
+ "</i>) is not absolute, edit the <i> generation settings</i> "
"(tab 'directory'), or edit the package (tab 'C++')</b></font><br>");
UmlCom::bye(n_errors() + 1);
UmlCom::fatal_error("UmlPackage::source_path");
}
}
if (f.isEmpty())
return dir.h;
QDir d(dir.h);
if (! d.exists())
create_directory(dir.h); // don't return on error
QByteArray temp = d.filePath(f).toLatin1();
WrapperStr df = (dir.h_absolute || relto.isEmpty())
? WrapperStr(temp.constData())
: relative_path(d, relto) + f;
return df + WrapperStr(".") + CppSettings::headerExtension();
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:39,代码来源:UmlPackage.cpp
示例16: create
void UmlActivityObject::importIt(FileIn & in, Token & token, UmlItem * where)
{
where = where->container(anActivityObject, token, in);
if (where != 0) {
WrapperStr s = token.valueOf("name");
UmlActivityObject * a = create(where, s);
if (a == 0)
in.error("cannot create activity object '"
+ s + "' in '" + where->name() + "'");
a->addItem(token.xmiId(), in);
WrapperStr ste;
s = token.xmiType();
switch (((const char *) s)[0]) {
case 'D':
ste = "datastore";
break;
case 'C':
ste = "centralBuffer";
break;
default:
break;
}
a->import_it(in, token);
if (! ste.isNull())
a->set_Stereotype(ste);
}
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:38,代码来源:UmlActivityObject.cpp
示例17: write_default_value
void UmlItem::write_default_value(FileOut & out, WrapperStr v, UmlItem * who, int rank)
{
if (! v.isEmpty()) {
if (v[0] == '=') {
v = v.mid(1);
if (v.isEmpty())
return;
}
out.indent();
out << "<defaultValue xmi:type=\"uml:LiteralString\"";
if (rank == -1)
out.id_prefix(who, "VALUE_");
else
out.id_prefix(who, "VALUE", rank);
out << " value=\"";
out.quote((const char *)v); //[jasa] ambiguous call
out << "\"/>\n";
}
}
开发者ID:vresnev,项目名称:douml,代码行数:23,代码来源:UmlItem.cpp
示例18: multiplicity
void UmlActivityObject::importMultiplicity(FileIn & in, Token & token, bool upper)
{
WrapperStr s = token.valueOf("value");
if (!s.isEmpty() &&
(s != "Unspecified")) { // VP
WrapperStr m = multiplicity();
if (m.isEmpty())
m = s;
else if (m != s) {
if (upper)
m += ".." + s;
else
m = s + ".." + m;
}
set_Multiplicity(m);
}
if (! token.closed())
in.finish(token.what());
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:23,代码来源:UmlActivityObject.cpp
示例19: idref_datatype
void FileOut::idref_datatype(const WrapperStr & t)
{
if (t.isEmpty())
return;
QMap<QString, int>::ConstIterator it = _datatypes.find(t);
if (it == _datatypes.end())
it = _datatypes.insert(t, _datatypes.count());
((QTextStream &) *this) << " xmi:idref=\"BOUML_datatype_"
<< it.value() << '"';
}
开发者ID:gilbertoca,项目名称:douml,代码行数:14,代码来源:FileOut.cpp
示例20: generate_def
void UmlExtraClassMember::generate_def(QTextStream & f, WrapperStr indent,
bool h, WrapperStr templates,
WrapperStr, WrapperStr, WrapperStr)
{
if (!cppDef().isEmpty() &&
((isCppInline() || !templates.isEmpty()) == h)) {
const char * p = cppDef();
if (*p != '#')
f << indent;
f << p;
}
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:14,代码来源:UmlExtraClassMember.cpp
注:本文中的WrapperStr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论