コード例 #1
0
ファイル: QOS_XML_Loader.cpp プロジェクト: binary42/OCI
  char*
  QOS_XML_Loader::get_profile_name (const char * qos_profile)
  {
    if (qos_profile)
      {
        char* buf = ACE_OS::strdup (qos_profile);
        ACE_Tokenizer_T<char> tok (buf);
        tok.delimiter_replace ('#', 0);
        const char * lib_name = tok.next ();
        const char * prof_name = tok.next ();

        if (lib_name == 0 || prof_name == 0 || tok.next () != 0)
          {
            ACE_OS::free (buf);
            if (DCPS_debug_level > 5)
              {
                ACE_ERROR ((LM_ERROR,
                              "get_profile_name <%C> - "
                              "Error: malformed qos_profile. Expected format: "
                              "<xml_file_base_name>#<profile_name>\n",
                              qos_profile));
              }
            return 0;
          }

        char * ret = ACE_OS::strdup (prof_name);
        ACE_OS::free (buf);
        return ret;
      }

    return 0;
  }
コード例 #2
0
ファイル: QOS_XML_Loader.cpp プロジェクト: binary42/OCI
  char*
  QOS_XML_Loader::get_xml_file_name (const char * qos_profile)
  {
    if (qos_profile)
      {
        char* buf = ACE_OS::strdup (qos_profile);
        ACE_Tokenizer_T<char> tok (buf);
        tok.delimiter_replace ('#', 0);
        const char * file_name = tok.next ();

        if (file_name == 0)
          {
            ACE_OS::free (buf);
            if (DCPS_debug_level > 5)
              {
                ACE_ERROR ((LM_ERROR,
                              "get_xml_file_name <%C> - "
                              "Error: malformed qos_profile. Expected format: "
                              "<xml_file_base_name>#<profile_name>\n",
                              qos_profile));
              }
            return 0;
          }

        char * ret = (char*)ACE_OS::malloc (ACE_OS::strlen (file_name) + 5);
        ret = ACE_OS::strcpy (ret, file_name);
        ret = ACE_OS::strcat (ret, ".xml");
        ACE_OS::free (buf);
        return ret;
      }

    return 0;
  }
コード例 #3
0
ファイル: NDDS_Latency_Sender.cpp プロジェクト: CCJY/ATCD
void
split_qos (const char * qos)
{
  char* buf = ACE_OS::strdup (qos);
  ACE_Tokenizer_T<char> tok (buf);
  tok.delimiter_replace ('#', 0);
  for (char *p = tok.next (); p; p = tok.next ())
    {
      if (!lib_name_)
        {
          lib_name_ = ACE_OS::strdup (p);
        }
      else if (!prof_name_)
        {
          prof_name_ = ACE_OS::strdup (p);
        }
    }
  ACE_OS::free (buf);
  ACE_DEBUG ((LM_DEBUG, "Sender : Found QoS profile %C %C\n",
    lib_name_,
    prof_name_));
}
コード例 #4
0
ファイル: Utils.cpp プロジェクト: DOCGroup/CIAO
    char * get_library_name (const char * qos_profile)
    {
      char* buf = ACE_OS::strdup (qos_profile);
      ACE_Tokenizer_T<char> tok (buf);
      tok.delimiter_replace ('#', 0);
      const char * lib_name = tok.next ();

      if (lib_name == 0)
        {
          ACE_OS::free (buf);
          DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
                        "get_library_name <%C> - "
                        "Error: malformed qos_profile. Expected format: "
                        "<library_name>#<profile_name>\n",
                        qos_profile));
          return 0;
        }

      char * ret = ACE_OS::strdup (lib_name);
      ACE_OS::free (buf);
      return ret;
    }
コード例 #5
0
    void
    build_name (const char *name, CosNaming::Name &nm)
    {
      CIAO_TRACE ("Name_Utilities::build_name");

      char* buf = ACE_OS::strdup (name);

      ACE_Tokenizer_T<char> parser (buf);
      parser.delimiter ('/');

      for (char *next = parser.next (); next; next = parser.next ())
        {
          CORBA::ULong const i = nm.length ();
          nm.length (i + 1);

          CIAO_DEBUG (9, (LM_TRACE, CLINFO
                          "Name_Utilities::build_name - "
                          "Found name component <%C>\n",
                          next));

          nm[i].id = CORBA::string_dup (next);
        }
      ACE_OS::free (buf);
    }