blob: 802c87363b64ca597a321ad7fb8f254c76cae478 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
// $Id$
#include "dds4ccm/impl/ndds/Utils.h"
#include "dds4ccm/impl/logger/Log_Macros.h"
#include "ace/Tokenizer_T.h"
namespace CIAO
{
namespace NDDS
{
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;
}
char * get_profile_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 ();
const char * prof_name = tok.next ();
if (lib_name == 0 || prof_name == 0 || tok.next () != 0)
{
ACE_OS::free (buf);
DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO
"get_profile_name <%C> - "
"Error: malformed qos_profile. Expected format: "
"<library_name>#<profile_name>\n",
qos_profile));
return 0;
}
char * ret = ACE_OS::strdup (prof_name);
ACE_OS::free (buf);
return ret;
}
}
}
|