static Character* __cdecl common_tempnam( Character const* const alternative, Character const* const prefix, int const block_use, char const* const file_name, int const line_number ) throw() { // These are referenced only in the Debug CRT build UNREFERENCED_PARAMETER(block_use); UNREFERENCED_PARAMETER(file_name); UNREFERENCED_PARAMETER(line_number); typedef __acrt_stdio_char_traits<Character> stdio_traits; Character const* directory = nullptr; __crt_unique_heap_ptr<Character const> const directory_cleanup(get_directory(alternative, &directory)); unsigned const prefix_length = prefix != nullptr ? static_cast<unsigned>(stdio_traits::tcslen(prefix)) : 0; // The 12 allows for a backslash, a ten character temporary string, and a // null terminator. unsigned const buffer_size = static_cast<unsigned>(stdio_traits::tcslen(directory)) + prefix_length + 12; __crt_unique_heap_ptr<Character, __crt_public_free_policy> result( static_cast<Character*>(_calloc_dbg( buffer_size, sizeof(Character), block_use, file_name, line_number))); if (!result) return nullptr; *result.get() = 0; _ERRCHECK(stdio_traits::tcscat_s(result.get(), buffer_size, directory)); if (__crt_stdio_path_requires_backslash(directory)) { static Character const backslash[] = { '\\', '\0' }; _ERRCHECK(stdio_traits::tcscat_s(result.get(), buffer_size, backslash)); } if (prefix != nullptr) { _ERRCHECK(stdio_traits::tcscat_s(result.get(), buffer_size, prefix)); } Character* const ptr = result.get() + stdio_traits::tcslen(result.get()); size_t const ptr_size = buffer_size - (ptr - result.get()); if (!compute_name(result.get(), ptr, ptr_size, prefix_length)) return nullptr; return result.detach(); }
void UmlOperation::generate(QTextStream & f, const WrapperStr & cl_stereotype, WrapperStr indent) { if (!javaDecl().isEmpty()) { const char * p = javaDecl(); const char * pp = 0; const char * afterparam = 0; const Q3ValueList<UmlParameter> & params = this->params(); unsigned rank; const char * body_indent = strstr(p, "${body}"); if (body_indent != 0) { while ((body_indent != p) && ((body_indent[-1] == ' ') || (body_indent[-1] == '\t'))) body_indent -= 1; } // manage old style indent while ((*p == ' ') || (*p == '\t')) indent += *p++; f << indent; for (;;) { if (*p == 0) { if (pp == 0) break; // comment management done p = pp; pp = 0; if (*p == 0) break; f << indent; } if (*p == '\n') { f << *p++; if (p == body_indent) p = generate_body(f, indent, p); else if (*p) f << indent; } else if (*p == '{') { if (afterparam != 0) { if (cl_stereotype == "@interface") { if (strstr(afterparam, "default") != 0) afterparam = 0; else { f << ";"; p = bypass_body(p); continue; } } else if (isAbstract() || (cl_stereotype == "interface")) { f << ";"; p = bypass_body(p); continue; } } f << '{'; p += 1; } else if (*p == '@') manage_alias(p, f); else if (*p != '$') { if (p == body_indent) p = generate_body(f, indent, p); else f << *p++; } else if (!strncmp(p, "${comment}", 10)) manage_comment(p, pp, JavaSettings::isGenerateJavadocStyleComment()); else if (!strncmp(p, "${description}", 14)) manage_description(p, pp); else if (!strncmp(p, "${visibility}", 13)) { p += 13; generate_visibility(f, cl_stereotype); } else if (!strncmp(p, "${final}", 8)) { p += 8; if (isJavaFinal()) f << "final "; } else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) f << "static "; } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract() && (cl_stereotype != "interface") && (cl_stereotype != "@interface")) f << "abstract "; } else if (!strncmp(p, "${synchronized}", 15)) { p += 15; if (isJavaSynchronized()) f << "synchronized "; } else if (!strncmp(p, "${type}", 7)) { p += 7; UmlClass::write(f, returnType()); } else if (!strncmp(p, "${stereotype}", 13)) { p += 13; // get/set relation with multiplicity > 1 f << JavaSettings::relationAttributeStereotype(stereotype()); } else if (!strncmp(p, "${name}", 7)) { p += 7; f << compute_name(); } else if (!strncmp(p, "${(}", 4)) { p += 4; f << '('; } else if (!strncmp(p, "${)}", 4)) { p += 4; f << ')'; afterparam = p; } else if (sscanf(p, "${t%u}", &rank) == 1) { if (!generate_type(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (sscanf(p, "${p%u}", &rank) == 1) { if (!generate_var(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (!strncmp(p, "${throws}", 9)) { p += 9; const char * sep; const Q3ValueList<UmlTypeSpec> & exceptions = this->exceptions(); Q3ValueList<UmlTypeSpec>::ConstIterator it; for (it = exceptions.begin(), sep = " throws "; it != exceptions.end(); ++it, sep = ", ") { f << sep; UmlClass::write(f, *it); } } else if (!strncmp(p, "${staticnl}", 11)) { p += 11; if (isClassMember()) { f << '\n'; if (*p) f << indent; } else f << ' '; } else if (!strncmp(p, "${body}", 7) && (pp == 0)) // not in comment p = generate_body(f, indent, p); else if (!strncmp(p, "${association}", 14)) { p += 14; UmlClassMember * m; if (((m = getOf()) != 0) && (m->kind() == aRelation)) UmlClass::write(f, ((UmlRelation *) m)->association()); else if (((m = setOf()) != 0) && (m->kind() == aRelation)) UmlClass::write(f, ((UmlRelation *) m)->association()); } else if (!strncmp(p, "${@}", 4)) { p += 4; if (pp != 0) f << "${@}"; else if (! javaAnnotations().isEmpty()) { pp = p; p = javaAnnotations(); } } else f << *p++; } f << '\n'; } }
void UmlOperation::generate(QTextStream & f, const WrapperStr &, WrapperStr indent, BooL & indent_needed, int &, const WrapperStr &) { const char * p = pythonDecl(); if ((p == 0) || (*p == 0)) return; const char * pp = 0; WrapperStr saved_indent = indent; WrapperStr indent_step = PythonSettings::indentStep(); const char * afterparam = 0; const QList<UmlParameter> & params = this->params(); unsigned rank; bool isinline = TRUE; bool in_params = FALSE; for (;;) { if (*p == 0) { if (pp == 0) break; // comment management done p = pp; if (*p == 0) break; pp = 0; indent = saved_indent; } if (*p == '@') manage_alias(p, f, indent, indent_needed); else if (*p != '$') { if (indent_needed) { indent_needed = FALSE; f << indent; } switch (*p) { case ':': if (pp == 0) { indent += indent_step; saved_indent = indent; indent_step = ""; } break; case '\n': indent_needed = TRUE; break; } f << *p++; } else if (!strncmp(p, "${comment}", 10)) manage_comment(p, pp); else if (!strncmp(p, "${description}", 14)) manage_description(p, pp); else if (!strncmp(p, "${docstring}", 12)) manage_docstring(p, pp, indent_needed, indent, saved_indent); else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) { if (indent_needed) f << indent; else indent_needed = TRUE; f << "@staticmethod\n"; } } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract()) { if (indent_needed) f << indent; else indent_needed = TRUE; f << "@abstractmethod\n"; } } else if (!strncmp(p, "${@}", 4)) { p += 4; manage_decorators(f, pythonDecorators(), indent, indent_needed); } else if (!strncmp(p, "${name}", 7)) { if (indent_needed) { indent_needed = FALSE; f << indent; } p += 7; f << compute_name(); } else if (!strncmp(p, "${class}", 8)) { if (indent_needed) { indent_needed = FALSE; f << indent; } p += 8; f << parent()->name(); } else if (!strncmp(p, "${(}", 4)) { p += 4; f << '('; in_params = TRUE; } else if (!strncmp(p, "${)}", 4)) { p += 4; f << ')'; afterparam = p; in_params = FALSE; } else if (sscanf(p, "${t%u}", &rank) == 1) { if (indent_needed) { indent_needed = FALSE; f << indent; } if (!generate_type(params, rank, f, in_params)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (sscanf(p, "${p%u}", &rank) == 1) { if (indent_needed) { indent_needed = FALSE; f << indent; } if (!generate_var(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (sscanf(p, "${v%u}", &rank) == 1) { if (!generate_init(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (!strncmp(p, "${body}", 7) && (pp == 0)) {// not in comment isinline = FALSE; p = generate_body(f, indent, indent_needed, p); } else if (!strncmp(p, "${association}", 14)) { p += 14; UmlClassMember * m; if ((((m = getOf()) != 0) || ((m = setOf()) != 0)) && (m->kind() == aRelation)) { if (indent_needed) { indent_needed = FALSE; f << indent; } UmlClass::write(f, ((UmlRelation *) m)->association()); } } else if (!strncmp(p, "${type}", 7)) { p += 7; const UmlTypeSpec & t = returnType(); if ((t.type != 0) || !t.explicit_type.isEmpty()) { f << " -> "; UmlClass::write(f, t); } } else { // strange if (indent_needed) { indent_needed = FALSE; f << indent; } f << *p++; } } if (isinline) { if (indent_needed) f << indent << '\n'; else f << '\n'; indent_needed = TRUE; } }
void UmlOperation::gen_python_decl(QByteArray s, bool descr) { QByteArray cl_stereotype = PythonSettings::classStereotype(parent()->stereotype()); const char * p = bypass_comment(s); const QList<UmlParameter> & pa = params(); unsigned npa = pa.count(); bool in_params = FALSE; unsigned rank; while (*p) { if (!strncmp(p, "${comment}", 10)) p += 10; else if (!strncmp(p, "${description}", 14)) p += 14; else if (!strncmp(p, "${docstring}", 12)) p += 12; else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) fw.write("@staticmethod<br />"); } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract()) fw.write("@abstractmethod<br />"); } else if (!strncmp(p, "${@}", 4)) { p += 4; writeq(pythonDecorators()); } else if (!strncmp(p, "${name}", 7)) { p += 7; writeq(compute_name(pythonNameSpec())); } else if (!strncmp(p, "${class}", 8)) { p += 8; parent()->write(); } else if (!strncmp(p, "${(}", 4)) { p += 4; fw.write('('); in_params = TRUE; } else if (!strncmp(p, "${)}", 4)) { p += 4; fw.write(')'); in_params = FALSE; } else if (sscanf(p, "${t%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) { const UmlTypeSpec & t = pa[rank].type; if (! t.toString().isEmpty()) { if (in_params) fw.write(": "); write(t, pythonLanguage); } } else fw.write("???"); } else if (sscanf(p, "${p%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) { fw.write('$'); writeq(pa[rank].name); } else fw.write("???"); } else if (sscanf(p, "${v%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank >= npa) fw.write("???"); else if (! pa[rank].default_value.isEmpty()) { fw.write(" = "); writeq(pa[rank].default_value); } } else if (!strncmp(p, "${type}", 7)) { p += 7; const UmlTypeSpec & t = returnType(); if (! t.toString().isEmpty()) { fw.write(" -> "); write(t, pythonLanguage); } } else if (*p == ':') { if (descr) fw.write(*p++); else break; } else if (*p == '\r') p += 1; else if (*p == '@') manage_alias(p); else writeq(*p++); } }
void UmlOperation::gen_php_decl(QByteArray s, bool descr) { QByteArray cl_stereotype = PhpSettings::classStereotype(parent()->stereotype()); const char * p = bypass_comment(s); const QList<UmlParameter> & pa = params(); unsigned npa = pa.count(); unsigned rank; while (*p) { if (!strncmp(p, "${comment}", 10)) p += 10; else if (!strncmp(p, "${description}", 14)) p += 14; else if (!strncmp(p, "${final}", 8)) { p += 8; if (isPhpFinal()) fw.write("final "); } else if (!strncmp(p, "${visibility}", 13)) { p += 13; UmlItem::write(visibility(), phpLanguage); fw.write(' '); } else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) fw.write("static "); } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract() && (cl_stereotype != "interface")) fw.write("abstract "); } else if (!strncmp(p, "${name}", 7)) { p += 7; writeq(compute_name(phpNameSpec())); } else if (!strncmp(p, "${(}", 4)) { p += 4; fw.write('('); } else if (!strncmp(p, "${)}", 4)) { p += 4; fw.write(')'); } else if (!strncmp(p, "${staticnl}", 11)) break; else if (sscanf(p, "${t%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) write(pa[rank].type, phpLanguage); else fw.write("???"); } else if (sscanf(p, "${p%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) { fw.write('$'); writeq(pa[rank].name); } else fw.write("???"); } else if (sscanf(p, "${v%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank >= npa) fw.write("???"); else if (! pa[rank].default_value.isEmpty()) { fw.write(" = "); writeq(pa[rank].default_value); } } else if (*p == '\r') p += 1; else if (*p == '\n') { if (descr) { fw.write("<br />"); p += 1; } else { fw.write(' '); do p += 1; while ((*p != 0) && (*p <= ' ')); } } else if ((*p == '{') || (*p == ';')) { if (descr) fw.write(*p++); else break; } else if (*p == '@') manage_alias(p); else writeq(*p++); } }
void UmlOperation::gen_java_decl(QByteArray s, bool descr) { const char * p = bypass_comment(s); const QList<UmlParameter> & pa = params(); unsigned npa = pa.count(); unsigned rank; while (*p) { if (!strncmp(p, "${comment}", 10)) p += 10; else if (!strncmp(p, "${description}", 14)) p += 14; else if (!strncmp(p, "${final}", 8)) { p += 8; if (isJavaFinal()) fw.write("final "); } else if (!strncmp(p, "${visibility}", 13)) { p += 13; UmlItem::write(visibility(), javaLanguage); fw.write(' '); } else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) fw.write("static "); } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract()) fw.write("abstract "); } else if (!strncmp(p, "${synchronized}", 15)) { p += 15; if (isJavaSynchronized()) fw.write("synchronized "); } else if (!strncmp(p, "${type}", 7)) { p += 7; write(returnType(), javaLanguage); } else if (!strncmp(p, "${name}", 7)) { p += 7; writeq(compute_name(javaNameSpec())); } else if (!strncmp(p, "${(}", 4)) { p += 4; fw.write('('); } else if (!strncmp(p, "${)}", 4)) { p += 4; fw.write(')'); } else if (!strncmp(p, "${throws}", 9)) { p += 9; const char * sep = " throws "; const QList<UmlTypeSpec> e = exceptions(); unsigned n = e.count(); for (unsigned index2 = 0; index2 != n; index2 += 1) { fw.write(sep); sep = ", "; write(e[index2], javaLanguage); } } else if (!strncmp(p, "${staticnl}", 11)) break; else if (sscanf(p, "${t%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) write(pa[rank].type, javaLanguage); else fw.write("???"); } else if (sscanf(p, "${p%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) writeq(pa[rank].name); else fw.write("???"); } else if (!strncmp(p, "${stereotype}", 13)) { p += 13; // get/set relation with multiplicity > 1 UmlClassMember * m = getOf(); if ((m != 0) || ((m = setOf()) != 0)) writeq(JavaSettings::relationAttributeStereotype(m->stereotype())); } else if (!strncmp(p, "${association}", 14)) { p += 14; // get/set relation with multiplicity > 1 UmlClassMember * m = getOf(); if (((m != 0) || ((m = setOf()) != 0)) && (m->kind() == aRelation)) write(((UmlRelation *) m)->association(), javaLanguage); } else if (!strncmp(p, "${@}", 4)) p += 4; else if (*p == '\r') p += 1; else if (*p == '\n') { if (descr) { fw.write("<br />"); p += 1; } else { fw.write(' '); do p += 1; while ((*p != 0) && (*p <= ' ')); } } else if ((*p == '{') || (*p == ';')) { if (descr) fw.write(*p++); else break; } else if (*p == '@') manage_alias(p); else writeq(*p++); } }
void UmlOperation::gen_cpp_decl(QByteArray s, bool descr) { const char * p = bypass_comment(s); if (! descr) { write((cppVisibility() == DefaultVisibility) ? visibility() : cppVisibility(), cppLanguage); fw.write(": "); p = bypass_comment(s); } else p = s; const QList<UmlParameter> & pa = params(); unsigned npa = pa.count(); unsigned rank; while (*p) { if (!strncmp(p, "${comment}", 10)) p += 10; else if (!strncmp(p, "${description}", 14)) p += 14; else if (!strncmp(p, "${friend}", 9)) { p += 9; if (isCppFriend()) fw.write("friend "); } else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) fw.write("static "); } else if (!strncmp(p, "${inline}", 9)) { p += 9; if (isCppInline()) fw.write("inline "); } else if (!strncmp(p, "${virtual}", 10)) { p += 10; if (isCppVirtual()) fw.write("virtual "); } else if (!strncmp(p, "${type}", 7)) { p += 7; write(returnType(), cppLanguage); } else if (!strncmp(p, "${name}", 7)) { p += 7; writeq(compute_name(cppNameSpec())); } else if (!strncmp(p, "${(}", 4)) { p += 4; fw.write('('); } else if (!strncmp(p, "${)}", 4)) { p += 4; fw.write(')'); } else if (!strncmp(p, "${const}", 8)) { p += 8; if (isCppConst()) fw.write(" const"); } else if (!strncmp(p, "${volatile}", 11)) { p += 11; if (isVolatile()) fw.write(" volatile"); } else if (!strncmp(p, "${throw}", 8)) { p += 8; const char * sep = " throw ("; QList<UmlTypeSpec> e = exceptions(); unsigned n = e.count(); unsigned index2; for (index2 = 0; index2 != n; index2 += 1) { fw.write(sep); sep = ", "; write(e[index2], cppLanguage); } if (index2 != 0) fw.write(')'); else if (CppSettings::operationForceThrow()) fw.write(" throw ()"); } else if (sscanf(p, "${t%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < npa) write(pa[rank].type, cppLanguage); else fw.write("???"); } else if (sscanf(p, "${p%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank < pa.count()) writeq(pa[rank].name); else fw.write("???"); } else if (sscanf(p, "${v%u}", &rank) == 1) { p = strchr(p, '}') + 1; if (rank >= pa.count()) fw.write("???"); else if (! pa[rank].default_value.isEmpty()) { fw.write(" = "); writeq(pa[rank].default_value); } } else if (!strncmp(p, "${abstract}", 11)) { if (isAbstract()) fw.write("= 0 "); break; } else if (!strncmp(p, "${stereotype}", 13)) { p += 13; // get/set relation with multiplicity > 1 UmlClassMember * m = getOf(); if ((m != 0) || ((m = setOf()) != 0)) writeq(CppSettings::relationAttributeStereotype(m->stereotype())); } else if (!strncmp(p, "${association}", 14)) { p += 14; // get/set relation with multiplicity > 1 UmlClassMember * m = getOf(); if (((m != 0) || ((m = setOf()) != 0)) && (m->kind() == aRelation)) write(((UmlRelation *) m)->association(), cppLanguage); } else if (*p == '\r') p += 1; else if (*p == '\n') { if (descr) { fw.write("<br />"); p += 1; } else { fw.write(' '); do p += 1; while ((*p != 0) && (*p <= ' ')); } } else if ((*p == '{') || (*p == ';')) { if (descr) fw.write(*p++); else break; } else if (*p == '@') manage_alias(p); else writeq(*p++); } }
void UmlOperation::generate(QTextStream & f, const WrapperStr & cl_stereotype, WrapperStr indent, int &) { if (!phpDecl().isEmpty()) { const char * p = phpDecl(); const char * pp = 0; const char * afterparam = 0; const Q3ValueList<UmlParameter> & params = this->params(); unsigned rank; const char * body_indent = strstr(p, "${body}"); if (body_indent != 0) { while ((body_indent != p) && ((body_indent[-1] == ' ') || (body_indent[-1] == '\t'))) body_indent -= 1; } // manage old style indent while ((*p == ' ') || (*p == '\t')) indent += *p++; f << indent; for (;;) { if (*p == 0) { if (pp == 0) break; // comment management done p = pp; pp = 0; if (*p == 0) break; f << indent; } if (*p == '\n') { f << *p++; if (p == body_indent) p = generate_body(f, indent, p); else if (*p) f << indent; } else if (*p == '{') { if (isAbstract() || (cl_stereotype == "interface")) { f << ";"; break; } else { f << '{'; p += 1; } } else if (*p == '@') manage_alias(p, f); else if (*p != '$') { if (p == body_indent) p = generate_body(f, indent, p); else f << *p++; } else if (!strncmp(p, "${comment}", 10)) manage_comment(p, pp, PhpSettings::isGenerateJavadocStyleComment()); else if (!strncmp(p, "${description}", 14)) manage_description(p, pp); else if (!strncmp(p, "${visibility}", 13)) { p += 13; generate_visibility(f); } else if (!strncmp(p, "${final}", 8)) { p += 8; if (isPhpFinal()) f << "final "; } else if (!strncmp(p, "${static}", 9)) { p += 9; if (isClassMember()) f << "static "; } else if (!strncmp(p, "${abstract}", 11)) { p += 11; if (isAbstract() && (cl_stereotype != "interface")) f << "abstract "; } else if (!strncmp(p, "${name}", 7)) { p += 7; f << compute_name(); } else if (!strncmp(p, "${(}", 4)) { p += 4; f << '('; } else if (!strncmp(p, "${)}", 4)) { p += 4; f << ')'; afterparam = p; } else if (sscanf(p, "${t%u}", &rank) == 1) { if (!generate_type(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (sscanf(p, "${p%u}", &rank) == 1) { if (!generate_var(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (sscanf(p, "${v%u}", &rank) == 1) { if (!generate_init(params, rank, f)) param_error(parent()->name(), name(), rank); p = strchr(p, '}') + 1; } else if (!strncmp(p, "${staticnl}", 11)) { p += 11; if (isClassMember()) { f << '\n'; if (*p) f << indent; } else f << ' '; } else if (!strncmp(p, "${body}", 7) && (pp == 0)) // not in comment p = generate_body(f, indent, p); else if (!strncmp(p, "${type}", 7)) { p += 7; UmlClass::write(f, returnType()); } else f << *p++; } f << '\n'; } }
void UmlOperation::generate_decl(QTextStream & f, const WrapperStr & cl_stereotype, WrapperStr indent, bool) { if (!idlDecl().isEmpty()) { if ((cl_stereotype != "interface") && (cl_stereotype != "valuetype")) { write_trace_header(); UmlCom::trace(" <font color=\"red\"><b>cannot have operation</b></font><br>"); incr_warning(); return; } const char * p = idlDecl(); const char * pp = 0; const QList<UmlParameter> & params = this->params(); const QList<UmlTypeSpec> & exceptions = this->exceptions(); unsigned rank; while ((*p == ' ') || (*p == '\t')) indent += *p++; if (*p != '#') f << indent; for (;;) { if (*p == 0) { if (pp == 0) break; // comment management done p = pp; pp = 0; if (*p == 0) break; if (*p != '#') f << indent; } if (*p == '\n') { f << *p++; if (*p && (*p != '#')) f << indent; } else if (*p == '@') manage_alias(p, f); else if (*p != '$') f << *p++; else if (!strncmp(p, "${comment}", 10)) manage_comment(p, pp); else if (!strncmp(p, "${description}", 14)) manage_description(p, pp); else if (!strncmp(p, "${oneway}", 9)) { p += 9; if (isIdlOneway()) f << "oneway "; } else if (!strncmp(p, "${type}", 7)) { p += 7; UmlClass::write(f, returnType()); } else if (!strncmp(p, "${name}", 7)) { p += 7; f << compute_name(); } else if (!strncmp(p, "${(}", 4)) { p += 4; f << '('; } else if (!strncmp(p, "${)}", 4)) { p += 4; f << ')'; } else if (sscanf(p, "${d%u}", &rank) == 1) { if (!generate_dir(params, rank, f)) param_error(parent()->name(), name(), rank, "declaration"); p = strchr(p, '}') + 1; } else if (sscanf(p, "${t%u}", &rank) == 1) { if (!generate_type(params, rank, f)) param_error(parent()->name(), name(), rank, "declaration"); p = strchr(p, '}') + 1; } else if (sscanf(p, "${p%u}", &rank) == 1) { if (!generate_var(params, rank, f)) param_error(parent()->name(), name(), rank, "declaration"); p = strchr(p, '}') + 1; } else if (!strncmp(p, "${stereotype}", 13)) { p += 13; f << IdlSettings::relationAttributeStereotype(stereotype()); } else if (!strncmp(p, "${raisesnl}", 11)) { if (exceptions.count() != 0) { f << '\n' << indent << " "; } p += 11; } else if (!strncmp(p, "${raises}", 9)) { p += 9; if (! exceptions.isEmpty()) { const char * sep; QList<UmlTypeSpec>::ConstIterator it; for (it = exceptions.begin(), sep = " raises ("; it != exceptions.end(); ++it, sep = " ") f << sep << IdlSettings::type((*it).toString()); f << ')'; } } else if (!strncmp(p, "${association}", 14)) { p += 14; UmlClassMember * m; if (((m = getOf()) != 0) && (m->kind() == aRelation)) f << IdlSettings::type(((UmlRelation *) m)->association().toString()); else if (((m = setOf()) != 0) && (m->kind() == aRelation)) f << IdlSettings::type(((UmlRelation *) m)->association().toString()); } else // strange f << *p++; } f << '\n'; } }