Esempio n. 1
0
ACE_CString
BE_GlobalData::get_include_block(BE_GlobalData::stream_enum_t which)
{
  Includes_t* inc = 0;

  switch (which) {
  case STREAM_H:
    inc = &inc_h_;
    break;
  case STREAM_CPP:
    inc = &inc_c_;
    break;
  case STREAM_IDL:
    inc = &inc_idl_;
    break;
  case STREAM_FACE_H:
    inc = &inc_face_h_;
    break;
  default:
    return "";
  }

  ACE_CString ret;
  Includes_t::const_iterator it = inc->begin(), end = inc->end();

  for (; it != end; ++it) {
    ACE_CString quote = (it->size() > 0 && (*it)[0] != '<') ? "\"" : "";
    ret += "#include " + quote + it->c_str() + quote + "\n";
  }

  if (which == STREAM_H) {
    ACE_CString exports = this->export_include();

    if (exports != "")
      ret += "#include \"" + exports + "\"\n";

  } else if (which == STREAM_CPP) {
    for (it = referenced_idl_.begin(), end = referenced_idl_.end(); it != end;
        ++it) {
      ret += ACE_CString("#include \"")
        + transform_referenced(make_relative(*it)).c_str() + "\"\n";
    }
  }

  return ret;
}
Esempio n. 2
0
ACE_CString
BE_GlobalData::get_include_block(BE_GlobalData::stream_enum_t which)
{
  Includes_t *inc = 0;

  switch (which) {
  case STUB_H:
    inc = &ch_;
    break;
  case STUB_CPP:
    inc = &cc_;
    break;
  case SKEL_H:
    inc = &sh_;
    break;
  case SKEL_CPP:
    inc = &sc_;
    break;
  default:
    return "";
  }

  ACE_CString ret;
  Includes_t::const_iterator it = inc->begin(), end = inc->end();

  for (; it != end; ++it) {
    ret += "#include \"" + ACE_CString(it->c_str()) + "\"\n";
  }

  if (which == STUB_H) {
    ACE_CString exports = this->stub_export_include();

    if (exports != "")
      ret += "#include \"" + exports + "\"\n";

  } else if (which == SKEL_H) {
    ACE_CString exports = this->skel_export_include();

    if (exports != "")
      ret += "#include \"" + exports + "\"\n";
  }

  return ret;
}