本文整理汇总了C++中Q3CString::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3CString::isEmpty方法的具体用法?C++ Q3CString::isEmpty怎么用?C++ Q3CString::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3CString
的用法示例。
在下文中一共展示了Q3CString::isEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: html
void UmlPackage::html(Q3CString pfix, unsigned int rank, unsigned int level) {
define();
if (stereotype() == "profile")
chapter("Profile", pfix, rank, "profile", level);
else
chapter("Package", pfix, rank, "package", level);
Q3CString s = description();
if (!s.isEmpty()) {
fw.write("<p>");
writeq(s);
fw.write("<br /></p>");
}
bool ul = FALSE;
s = cppNamespace();
if (!s.isEmpty()) {
fw.write("<p></p><ul>\n");
ul = TRUE;
fw.write("<li>C++ namespace : ");
writeq(s);
fw.write("</li>\n");
}
s = javaPackage();
if (!s.isEmpty()) {
if (! ul)
fw.write("<p></p><ul>");
ul = TRUE;
fw.write("<li>Java package : ");
writeq(s);
fw.write("</li>\n");
}
if (ul)
fw.write("</ul>\n");
write_dependencies();
UmlDiagram * d = associatedDiagram();
if (d != 0) {
fw.write("<p>Diagram : ");
d->write();
fw.write("</p>\n");
}
write_properties();
write_children(pfix, rank, level);
unload(FALSE, FALSE);
}
示例2: new_one
bool UmlAttribute::new_one(Class * container, Q3CString name,
aVisibility visibility, bool constp,
bool staticp, const Q3CString & value,
Q3CString comment, Q3CString description)
{
#ifdef TRACE
cout << "ATTRIBUTE '" << name << "'\n";
#endif
#ifndef REVERSE
if (visibility == PrivateVisibility)
return TRUE;
#endif
if (((const char *) name)[0] == '$')
name = name.mid(1);
UmlClass * cl = container->get_uml();
UmlAttribute * at = UmlBaseAttribute::create(cl, name);
if (at == 0) {
PhpCatWindow::trace(Q3CString("<font face=helvetica><b>cannot add attribute <i>")
+ name + "</i> in <i>" + cl->name()
+ "</i></b></font><br>");
return FALSE;
}
#ifdef REVERSE
Statistic::one_attribute_more();
#endif
if (!comment.isEmpty()) {
Q3CString s = (at->phpDecl().find("${description}") != -1)
? description : comment;
UmlTypeSpec t;
int index;
if (! (t.explicit_type = value_of(s, "@var", index)).isEmpty()) {
at->set_Type(t);
s.replace(index, t.explicit_type.length(), "${type}");
}
at->set_Description(s);
}
if (constp)
at->set_isReadOnly(TRUE);
if (staticp)
at->set_isClassMember(TRUE);
if (! value.isEmpty())
at->set_DefaultValue(value);
at->set_Visibility(visibility);
return TRUE;
}
示例3: addAssign
void UmlClass::addAssign(bool cte)
{
TRACE_FUNCTION;
UmlOperation * op = UmlOperation::create(this, "operator=");
if (op == 0)
UmlCom::trace("can't add assignment contructor");
else {
// add 'source' parameter
UmlParameter param;
param.name = "source";
param.dir = (cte) ? InputDirection : InputOutputDirection;
param.type.type = this;
op->addParameter(0, param);
// set return type, add the parameter profile
UmlTypeSpec t;
t.type = this;
op->set_ReturnType(t);
Q3CString p = (cte) ? "const ${t0} & ${p0}" : "${t0} & ${p0}";
Q3CString s;
int index;
s = op->cppDecl();
if (s.isEmpty())
s = CppSettings::operationDecl();
if ((index = s.find("${(}")) != -1)
s.insert(index + 4, (const char *)p); //[rageek] cast because Q3CString
if ((index = s.find("${type}")) != -1)
s.insert(index + 7, " &");
op->set_CppDecl(s);
s = op->cppDef();
if (s.isEmpty())
s = CppSettings::operationDef();
if ((index = s.find("${(}")) != -1)
s.insert(index + 4, (const char *)p); //[rageek] cast because Q3CString
if ((index = s.find("${type}")) != -1)
s.insert(index + 7, " &");
op->set_CppDef(s);
}
}
示例4: importInstantiate
void UmlClass::importInstantiate(File & f) {
if (scanning) {
f.skipNextForm();
return;
}
f.read("(");
f.read("object");
f.read("Instantiation_Relationship");
Q3CString id;
Q3CString ste;
Q3CString doc;
Q3Dict<Q3CString> prop;
Q3CString s2;
int k;
do {
k = f.readDefinitionBeginning(s2, id, ste, doc, prop);
} while (id.isEmpty());
for (;;) {
if (k == ATOM) {
if (s2 == "quidu")
break;
f.skipNextForm();
k = f.read(s2);
}
else
f.syntaxError(s2);
}
if (f.read(s2) != STRING)
f.syntaxError(s2, "quidu value");
UmlClass * target = (UmlClass *) findItem(s2, aClass);
if (target != 0) {
UmlRelation * r = UmlRelation::create(aRealization, this, target);
if (r == 0)
UmlCom::trace("<br>cannot create aRealization from '" +
fullName() + "' to '" + target->fullName() + "'");
else {
newItem(r, id);
if (!ste.isEmpty())
r->set_Stereotype(ste);
if (!doc.isEmpty())
r->set_Description(doc);
r->setProperties(prop);
}
}
f.skipBlock();
}
示例5: addCopy
void UmlClass::addCopy(bool cte)
{
TRACE_FUNCTION;
UmlOperation * op = UmlOperation::create(this, name());
if (op == 0)
UmlCom::trace("can't add copy contructor");
else {
// to see that it is a copy constructor
op->set_Stereotype("copy");
// add 'source' parameter
UmlParameter param;
param.name = "source";
param.dir = (cte) ? InputDirection : InputOutputDirection;
param.type.type = this;
op->addParameter(0, param);
// add the parameter profile, and
// remove the useless "${type} " mainly to remove the space
Q3CString p = (cte) ? "const ${t0} & ${p0}" : "${t0} & ${p0}";
Q3CString s;
int index;
s = op->cppDecl();
if (s.isEmpty())
s = CppSettings::operationDecl();
if ((index = s.find("${(}")) != -1)
s.insert(index + 4, (const char *)p); //[rageek] cast because Q3CString
if ((index = s.find("${type} ")) != -1)
s.remove(index, 8);
op->set_CppDecl(s);
s = op->cppDef();
if (s.isEmpty())
s = CppSettings::operationDef();
if ((index = s.find("${(}")) != -1)
s.insert(index + 4, (const char *)p); //[rageek] cast because Q3CString
if ((index = s.find("${type} ")) != -1)
s.remove(index, 8);
op->set_CppDef(s);
}
}
示例6: 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";
}
Q3CString ste = stereotype();
if (_gen_extension) {
const Q3Dict<Q3CString> up = properties();
Q3DictIterator<Q3CString> 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.contains(':') == 1)
// probably a stereotype part of profile
_stereotypes[ste].append(this);
}
示例7: importActivity
void UmlState::importActivity(FileIn & in, Token & token) {
Q3CString k = token.what();
const char * kstr = k;
Q3CString b = token.valueOf("body");
if (b.isEmpty()) {
if (! token.closed()) {
while (in.read(), !token.close(kstr)) {
Q3CString 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: read_list_elt
Q3CString Lex::read_list_elt()
{
const char * p = _context.pointer;
int level = 1;
Q3CString s;
while (!((s = read_word(TRUE)).isEmpty())) {
int c = *s;
if ((c == '>') || (c == ')') || (c == ']')) {
if (--level == 0)
break;
}
else if (c == ',') {
if (level == 1)
break;
}
else if ((c == '<') || (c == '(') || (c == '['))
level += 1;
}
if (! s.isEmpty())
unread_word();
char c = *_context.pointer;
*_context.pointer = 0;
s = p;
*_context.pointer = c;
return s.stripWhiteSpace();
}
示例9: write_condition
void UmlActivityAction::write_condition(FileOut & out, Q3CString cond, bool pre) {
if (! cond.isEmpty()) {
const char * k;
const char * K;
const char * body;
if (pre) {
k = "pre";
K = "PRE_";
body = "PRE_BODY_";
}
else {
k = "post";
K = "POST_";
body = "POST_BODY_";
}
out.indent();
out << '<' << k << "condition xmi:type=\"uml:Constraint\"";
out.id_prefix(this, K);
out << ">\n";
out.indent();
out << "\t<specification xmi:type=\"uml:OpaqueExpression\"";
out.id_prefix(this, body);
out << " body=\"";
out.quote(cond);
out << "\"/>\n";
out.indent();
out << "</" << k << "condition>\n";
}
}
示例10: decl
Q3CString UmlClass::decl() {
Q3CString result;
Q3CString close_template;
UmlArtifact * cp = associatedArtifact();
Q3CString nasp = ((UmlPackage *)
((cp != 0) ? (UmlItem *) cp : (UmlItem *) this)->package())
->cppNamespace();
if (! nasp.isEmpty()) {
int index =
// bypass :: allowing ::a...
((nasp.at(0) == ':') && (nasp != "::")) ? 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 += " } ";
}
Q3CString template1;
Q3CString template2;
get_template_prefixes(template1, template2);
if (!template1.isEmpty())
result += template1.left(template1.length() - 1) + ' ';
result += cpp_stereotype() + ' ';
return result + name() + ';' + close_template + '\n';
}
示例11: write_annotation
void UmlClassMember::write_annotation(FileOut & out) {
if (_lang == Java) {
Q3CString a = javaAnnotations();
if (!a.isEmpty()) {
switch (_taggedvalue_mode) {
case 1:
out.indent();
out << "<UML:ModelElement.taggedValue>\n";
out.indent();
out << "\t<UML:TaggedValue tag=\"annotations\" value=\"";
out.quote(a);
out << "\"/>\n";
out.indent();
out << "</UML:ModelElement.taggedValue>\n";
break;
case 2:
out.indent();
out << "<UML:ModelElement.taggedValue>\n";
out.indent();
out << "\t<UML:TaggedValue.tag>annotations</UML:TaggedValue.tag>\n";
out.indent();
out << "\t<UML:TaggedValue.value>";
out.quote(a);
out << "</UML:TaggedValue.value>\n";
out.indent();
out << "</UML:ModelElement.taggedValue>\n";
}
}
}
}
示例12: write
void UmlAcceptEventAction::write(FileOut & out) {
write_begin(out, "AcceptEventAction");
if (isUnmarshall())
out << " isUnmarshall=\"true\"";
Q3CString trig;
switch (_lang) {
case Uml:
trig = trigger();
break;
case Cpp:
trig = cppTrigger();
break;
default:
// java
trig = javaTrigger();
}
if (! trig.isEmpty()) {
out.ref(this, "trigger", "TRIGGER_");
write_end(out);
out.indent();
out << "<trigger xmi:type=\"uml:Trigger\"";
out.id_prefix(this, "TRIGGER_");
out << " name=\"";
out.quote(trig);
out << "\"/>\n";
}
else
write_end(out);
}
示例13: write_multiplicity
void UmlItem::write_multiplicity(FileOut & out, Q3CString s, UmlItem * who)
{
if (!s.isEmpty()) {
Q3CString min;
Q3CString 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 << "\"/>\n";
out.indent();
out << "<upperValue xmi:type=\"uml:LiteralString\"";
out.id_prefix(who, "MULTIPLICITY_U_");
out << " value=\"" << max << "\"/>\n";
}
}
示例14: c
void tst_Q3CString::isEmpty()
{
Q3CString a;
QVERIFY(a.isEmpty());
Q3CString c("Not empty");
QVERIFY(!c.isEmpty());
}
示例15: write_trace_header
void write_trace_header()
{
if (!Verbose && !TraceHeader.isEmpty()) {
UmlCom::trace("<hr>" + TraceHeader);
TraceHeader = "";
}
}