本文整理汇总了C++中WrapperStr::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ WrapperStr::isEmpty方法的具体用法?C++ WrapperStr::isEmpty怎么用?C++ WrapperStr::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WrapperStr
的用法示例。
在下文中一共展示了WrapperStr::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bypass
void FileIn::bypass(Token & tk)
{
static QSet<QString> bypassed;
WrapperStr s = tk.xmiType();
if (s.isEmpty()) {
QString k = tk.what();
if (!bypassed.contains(k)) {
warning("bypass <" + tk.what() + "...> (other cases not signaled)");
bypassed.insert(k);
}
}
else {
QString k = tk.what() + " " + s;
if (!bypassed.contains(k)) {
warning("bypass <" + tk.what() +
" xmi:type=\"" + s + "\"...> (other cases not signaled)");
bypassed.insert(k);
}
}
s = tk.xmiId();
if (! s.isEmpty())
BypassedIds.insert(s);
if (! tk.closed())
finish(tk.what());
}
示例2: import
void Manifestation::import(FileIn & in, Token & token, UmlArtifact * artifact)
{
WrapperStr s;
WrapperStr name;
WrapperStr utilized;
name = token.valueOf("name");
if (!(s = token.valueOf("utilizedelement")).isEmpty())
utilized = s;
else if (!(s = token.valueOf("client")).isEmpty())
utilized = s;
if (! token.closed()) {
WrapperStr k = token.what();
const char * kstr = k;
while (in.read(), !token.close(kstr)) {
s = token.what();
if (s == "utilizedelement")
utilized = token.xmiIdref();
else if ((s == "client") && s.isEmpty())
utilized = token.xmiIdref();
if (! token.closed())
in.finish(s);
}
}
if (utilized.isEmpty())
in.warning("'utilizedElement' and 'client' missing in Manifestation");
else
All.append(Manifestation(name, artifact, utilized));
}
示例3: generalizeDependRealize
void UmlClass::generalizeDependRealize(UmlItem * target, FileIn & in, int context, WrapperStr label, WrapperStr constraint)
{
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 * 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)
in.warning(r[context].err + name() + "' to '" + target->name() + "'");
else {
if (! label.isEmpty())
rel->set_Name(label);
if (! constraint.isEmpty() && (target->kind() == aClass))
((UmlRelation *) rel)->set_Constraint(constraint);
}
}
示例4: applyStereotype
void UmlPackage::applyStereotype(FileIn & in, Token & token)
{
WrapperStr prof_st;
Q3ValueList<WrapperStr> base_v;
WrapperStr s;
if (UmlClass::isAppliedStereotype(token, prof_st, base_v)) {
WrapperStr s;
Q3ValueList<WrapperStr>::Iterator it_ext;
for (it_ext = base_v.begin(); it_ext != base_v.end(); ++it_ext) {
WrapperStr s2;
if (token.valueOf(*it_ext, s2)) {
if (s.isEmpty())
s = s2;
else if (s != s2)
in.warning("doesn't refer to the same element ('" + s + "' != '" + s2 + "')");
}
}
if (s.isEmpty())
in.warning("value of 'base_...' is missing");
else {
UmlItem * elt = All[s];
if (elt == 0) {
if (!FileIn::isBypassedId(s))
in.warning("unknown reference '" + s + "'");
}
else {
elt->set_Stereotype(prof_st);
elt->UmlItem::applyStereotype(); // set properties
Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> it(props);
while (it.current()) {
WrapperStr k = it.currentKey().latin1();
if (token.valueOf(k.mid(k.findRev(':') + 1).lower(), s))
elt->set_PropertyValue(k, s);
++it;
}
}
}
if (! token.closed())
in.finish(token.what());
}
else
in.bypass(token);
}
示例5: write_description_properties
void UmlItem::write_description_properties(FileOut & out)
{
if (! description().isEmpty()) {
static int rank = 0;
out.indent();
out << "<ownedComment xmi:type=\"uml:Comment\" xmi:id=\"COMMENT_"
<< ++rank << "\" body=\"";
out.quote((const char *)description()); //[jasa] ambiguous call
out << "\"/>\n";
}
WrapperStr ste = stereotype();
if (_gen_extension) {
const Q3Dict<WrapperStr> up = properties();
Q3DictIterator<WrapperStr> it(up);
if (it.current()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\">\n";
if (! ste.isEmpty()) {
out.indent();
out << "\t<stereotype name=\"";
out.quote((const char *)ste); //[jasa] ambiguous call
out << "\"/>\n";
}
do {
out.indent();
out << "\t<taggedValue tag=\"";
out.quote((const char *)it.currentKey()); //[jasa] ambiguous call
out << "\" value=\"";
out.quote((const char *) * (it.current())); //[jasa] ambiguous call
out << "\"/>\n";
++it;
}
while (it.current());
out.indent();
out << "</xmi:Extension>\n";
}
else if (! ste.isEmpty()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\"><stereotype name=\"";
out.quote((const char *)ste); //[jasa] ambiguous call
out << "\"/></xmi:Extension>\n";
}
}
if (ste.operator QString().contains(':') == 1)
// probably a stereotype part of profile
_stereotypes[ste].append(this);
}
示例6: readFormal
void UmlClass::readFormal(FileIn & in, Token & token)
{
if (! token.closed()) {
signatures[token.xmiId()] = this;
WrapperStr k = token.what();
const char * kstr = k;
unsigned int rank = 0;
while (in.read(), !token.close(kstr)) {
WrapperStr s = token.what();
if (s == "parameter") {
// useless
if (! token.closed())
in.finish(token.what());
}
else if ((s == "ownedparameter") &&
(token.xmiType() == "uml:ClassifierTemplateParameter")) {
WrapperStr idparam = token.xmiId();
WrapperStr pname = token.valueOf("name"); // at least for VP
WrapperStr value;
if (! token.closed()) {
while (in.read(), !token.close("ownedparameter")) {
s = token.what();
if ((s == "ownedparameteredelement") ||
(s == "ownedelement")) {
s = token.valueOf("name");
if (! s.isEmpty())
pname = s;
}
else if (s == "defaultvalue")
value = token.valueOf("value");
if (! token.closed())
in.finish(token.what());
}
}
if (! pname.isEmpty()) {
UmlFormalParameter f(pname, value);
addFormal(rank++, f);
formalsId.append(idparam);
}
}
else if (! token.closed())
in.finish(token.what());
}
}
}
示例7: importActivity
void UmlState::importActivity(FileIn & in, Token & token)
{
WrapperStr k = token.what();
const char * kstr = k;
WrapperStr b = token.valueOf("body");
if (b.isEmpty()) {
if (! token.closed()) {
while (in.read(), !token.close(kstr)) {
WrapperStr s = token.what();
if (s == "body") {
b = in.body("body");
in.finish(k);
break;
}
else if ((s == "node") &&
(token.xmiType() == "uml:CallOperationAction")) {
s = token.valueOf("operation");
if (! s.isEmpty()) {
if (k == "entry")
UnresolvedWithContext::add(this, s, 0);
else if (k == "exit")
UnresolvedWithContext::add(this, s, 1);
else
UnresolvedWithContext::add(this, s, 2);
}
if (! token.closed())
in.finish("node");
in.finish(k);
return;
}
else if (! token.closed())
in.finish(s);
}
}
}
else if (! token.closed())
in.finish(k);
if (! b.isEmpty()) {
if (k == "entry")
set_EntryBehavior(b);
else if (k == "exit")
set_ExitBehavior(b);
else
set_DoActivity(b);
}
}
示例8: source_path
WrapperStr UmlPackage::source_path(const WrapperStr & f, WrapperStr relto)
{
if (!dir.read) {
dir.src = cppSrcDir();
dir.h = cppHDir();
dir.src_absolute = dir.h_absolute = FALSE;
QDir d_root(rootDir());
if (dir.src.isEmpty())
// considered given relative
dir.src = RootDir;
else if (QDir::isRelativePath(dir.src))
dir.src = d_root.filePath(dir.src);
else
dir.src_absolute = TRUE;
if (dir.h.isEmpty())
// considered given relative
dir.h = RootDir;
else if (QDir::isRelativePath(dir.h))
dir.h = d_root.filePath(dir.h);
else
dir.h_absolute = TRUE;
if (dir.src.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");
}
dir.read = TRUE;
}
if (f.isEmpty())
return dir.src;
QDir d(dir.src);
if (! d.exists())
create_directory(dir.src); // don't return on error
QByteArray temp = d.filePath(f).toLatin1();
WrapperStr df = (dir.src_absolute || relto.isEmpty())
? WrapperStr(temp.constData())
: relative_path(d, relto) + f;
return df + WrapperStr(".") + CppSettings::sourceExtension();
}
示例9: d_root
Package::Package(Package * parent, UmlPackage * pk)
: BrowserNode(parent, pk->name())
{
//if (text(0) == "unknown")
// unknown = this;
uml = pk;
QDir d_root(RootSDir);
h_path = force_final_slash(pk->cppHDir());
if (h_path.isEmpty())
h_path = RootCDir;
else if (QDir::isRelativePath(h_path)) {
if (RootCDir.isEmpty()) {
WrapperStr err = "<font face=helvetica><b>root path not set in <i>generation settings</i>, "
"don't know where is <i>" + h_path + "<i></b></font><br>";
UmlCom::trace(err);
}
else
h_path = force_final_slash(d_root.filePath(h_path));
}
src_path = force_final_slash(pk->cppSrcDir());
if (src_path.isEmpty())
src_path = RootCDir;
else if (QDir::isRelativePath(src_path)) {
if (RootCDir.isEmpty()) {
WrapperStr err = "<font face=helvetica><b>root path not set in <i>generation settings</i>, "
"don't know where is <i>" + src_path + "<i></b></font><br>";
UmlCom::trace(err);
}
else
src_path = force_final_slash(d_root.filePath(src_path));
}
namespace_ = pk->cppNamespace();
if (!h_path.isEmpty())
Pack_From_Path.replace(h_path, this);
if ((h_path != src_path) && !src_path.isEmpty())
Pack_From_Path.replace(src_path, this);
}
示例10: write_multiplicity
void UmlItem::write_multiplicity(FileOut & out, WrapperStr s, UmlItem * who)
{
if (!s.isEmpty()) {
WrapperStr min;
WrapperStr max;
int index = s.find("..");
if (index != -1) {
min = s.left(index).stripWhiteSpace();
max = s.mid(index + 2).stripWhiteSpace();
}
else
min = max = s.stripWhiteSpace();
out.indent();
out << "<lowerValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_L_");
out << " value=\"" << min.operator QString() << "\"/>\n";
out.indent();
out << "<upperValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_U_");
out << " value=\"" << max.operator QString() << "\"/>\n";
}
}
示例11: importComment
void UmlItem::importComment(FileIn & in, Token & token, UmlItem * where)
{
WrapperStr doc = readComment(in, token);
if (! doc.isEmpty())
where->set_Description(doc);
}
示例12: manage_decorators
static void manage_decorators(QTextStream & f, const WrapperStr & decorators,
QString indent, BooL & indent_needed)
{
if (! decorators.isEmpty()) {
int index = 0;
int index2;
while ((index2 = decorators.find("\n", index)) != -1) {
if (indent_needed)
f << indent;
else
indent_needed = TRUE;
f << decorators.mid(index, index2 + 1 - index);
index = index2 + 1;
}
if (index != (int) decorators.length()) {
if (indent_needed) {
f << indent;
indent_needed = FALSE;
}
f << decorators.mid(index);
}
}
}
示例13: importPrimitiveType
void UmlClass::importPrimitiveType(FileIn & in, Token & token, UmlItem *)
{
WrapperStr id = token.xmiId();
UmlTypeSpec t;
t.explicit_type = token.valueOf("name");
if (FromBouml) {
if (! token.closed()) {
BooL dummy;
in.read(); // <xmi:Extension extender="Bouml">
in.readWord(FALSE, dummy); // <
in.readWord(FALSE, dummy); // basedOn
t.type = dynamic_cast<UmlClass *>(All[in.readWord(FALSE, dummy)]);
if (t.type != 0)
// forget modifiers
t.explicit_type = "";
in.readWord(FALSE, dummy); // /
in.readWord(FALSE, dummy); // >
in.read(); // </xmi:Extension>
in.read(); // end of token
}
}
else if (! token.closed())
in.finish(token.what());
if (!id.isEmpty())
PrimitiveTypes[id] = t;
}
示例14: write_trace_header
void write_trace_header()
{
if (!Verbose && !TraceHeader.isEmpty()) {
UmlCom::trace("<hr>" + TraceHeader);
TraceHeader = "";
}
}
示例15: readComment
WrapperStr UmlItem::readComment(FileIn & in, Token & token)
{
in.bypassedId(token);
WrapperStr doc = token.valueOf("body");
if (! token.closed()) {
WrapperStr k = token.what();
const char * kstr = k;
while (in.read(), !token.close(kstr)) {
if (token.what() == "body") {
if (! doc.isEmpty())
doc += "\n";
doc += in.body("body");
}
else if (! token.closed())
in.finish(token.what());
}
}
return doc;
}