509 UTL_ScopedName*
name = node->name();
511 if (!(idl_global->is_dcps_type(name) ||
be_global->is_topic_type(node))) {
516 if (output_file.
length()) {
519 be_global->add_include(
"idl2jni_jni.h", BE_GlobalData::STREAM_CPP);
521 std::string type =
scoped(name);
523 std::string file, jniclass, jpackage;
524 for (UTL_ScopedName* sn = name; sn;
525 sn =
static_cast<UTL_ScopedName*
>(sn->tail())) {
526 std::string tmp = sn->head()->get_string();
527 if (!tmp.empty() && sn->tail()) {
532 ACE_TEXT(
"unable to create specified directory: %C"), file.c_str()));
535 for (
size_t i = tmp.find(
'_'); i < tmp.length();
536 i = tmp.find(
'_', i + 1)) {
537 tmp.insert(++i, 1,
'1');
540 if (!jniclass.empty() && sn->tail()) {
547 if (jpackage.size() && jpackage[jpackage.size() - 1] ==
'.') {
548 jpackage.resize(jpackage.size() - 1);
551 std::string clazz = name->last_component()->get_string();
552 file += clazz +
"TypeSupportImpl.java";
554 std::ofstream java(file.c_str());
555 java << (jpackage.size() ?
"package " :
"") << jpackage
556 << (jpackage.size() ?
";\n" :
"") <<
557 "public class " << clazz <<
"TypeSupportImpl extends _" << clazz
558 <<
"TypeSupportTAOPeer {\n" 559 " public " << clazz <<
"TypeSupportImpl() {\n" 560 " super(_jni_init());\n" 562 " private static native long _jni_init();\n" 565 "extern \"C\" JNIEXPORT jlong JNICALL\n" 566 "Java_" << jniclass <<
"TypeSupportImpl__1jni_1init(JNIEnv*, jclass) {\n" 567 " return reinterpret_cast<jlong>(static_cast<CORBA::Object_ptr>(new " 568 << type <<
"TypeSupportImpl));\n"
int mkdir(const char *path, mode_t mode=ACE_DEFAULT_DIR_PERMS)
std::string scoped(UTL_ScopedName *sn, EscapeContext ec=EscapeContext_Normal)
BE_GlobalData * be_global
size_type length(void) const