本文整理汇总了C++中ACE_NS_WString类的典型用法代码示例。如果您正苦于以下问题:C++ ACE_NS_WString类的具体用法?C++ ACE_NS_WString怎么用?C++ ACE_NS_WString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ACE_NS_WString类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
ACE_NS_String::ACE_NS_String (const ACE_NS_WString &s)
: len_ ((s.length () + 1) * sizeof (ACE_WCHAR_T)),
rep_ (s.rep ()),
delete_rep_ (true)
{
ACE_TRACE ("ACE_NS_String::ACE_NS_String");
}
示例2: object
int
ACE_Registry_Name_Space::rebind (const ACE_NS_WString &name,
const ACE_NS_WString &value,
const char *type)
{
ACE_UNUSED_ARG(type);
// Pointer to data
const ACE_WSTRING_TYPE *data = value.fast_rep ();
// Size
size_t size = value.length () * sizeof (ACE_WSTRING_TYPE);
// Represent value as an ACE_Registry::Object
ACE_Registry::Object object ((void *) data,
static_cast<u_long> (size),
REG_SZ);
// Add new <key>/<value> pair
#if defined (ACE_USES_WCHAR)
return this->context_.rebind (name.fast_rep (),
object);
#else
return this->context_.rebind (name.char_rep (),
object);
#endif /* ACE_USES_WCHAR */
}
示例3: ACE_TRACE
int
ACE_Remote_Name_Space::resolve (const ACE_NS_WString &name,
ACE_NS_WString &value,
char *&type)
{
ACE_TRACE ("ACE_Remote_Name_Space::resolve");
ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> name_urep (name.rep ());
ACE_UINT32 name_len =
static_cast<ACE_UINT32> (name.length () * sizeof (ACE_WCHAR_T));
ACE_Name_Request request (ACE_Name_Request::RESOLVE,
name_urep.get (),
name_len,
0, 0, 0, 0);
if (this->ns_proxy_.send_request (request) == -1)
return -1;
ACE_Name_Request reply;
if (this->ns_proxy_.recv_reply (reply) == -1)
return -1;
ACE_NS_WString temp (reply.value (), reply.value_len () / sizeof (ACE_WCHAR_T));
value = temp;
ACE_NEW_RETURN (type,
char[reply.type_len () + 1],
-1);
ACE_OS::strcpy (type, reply.type ());
return 0;
}
示例4: ACE_TRACE
int
ACE_Name_Handler::resolve (void)
{
ACE_TRACE (ACE_TEXT ("ACE_Name_Handler::resolve"));
#if 0
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("request for RESOLVE\n")));
#endif /* 0 */
ACE_NS_WString a_name (this->name_request_.name (),
this->name_request_.name_len () / sizeof (ACE_WCHAR_T));
// The following will deliver our reply back to client we
// pre-suppose success (indicated by type RESOLVE).
ACE_NS_WString avalue;
char *atype;
if (this->naming_context ()->resolve (a_name, avalue, atype) == 0)
{
ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> avalue_urep (avalue.rep ());
ACE_Name_Request nrq (ACE_Name_Request::RESOLVE,
0,
0,
avalue_urep.get (),
avalue.length () * sizeof (ACE_WCHAR_T),
atype, ACE_OS::strlen (atype));
delete[] atype;
return this->send_request (nrq);
}
ACE_Name_Request nrq (ACE_Name_Request::BIND, 0, 0, 0, 0, 0, 0);
this->send_request (nrq);
return 0;
}
示例5: defined
int
ACE_Registry_Name_Space::unbind (const ACE_NS_WString &name)
{
#if defined (ACE_USES_WCHAR)
return this->context_.unbind (name.fast_rep ());
#else
return this->context_.unbind (name.char_rep ());
#endif /* ACE_USES_WCHAR */
}
示例6: request
int
ACE_Remote_Name_Space::unbind (const ACE_NS_WString &name)
{
ACE_TRACE ("ACE_Remote_Name_Space::unbind");
ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> name_urep (name.rep ());
ACE_UINT32 name_len =
static_cast<ACE_UINT32> (name.length () * sizeof (ACE_WCHAR_T));
ACE_Name_Request request (ACE_Name_Request::UNBIND,
name_urep.get (),
name_len,
0, 0, 0, 0);
return this->ns_proxy_.request_reply (request);
}
示例7: ACE_TRACE
int
ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set,
const ACE_NS_WString &pattern)
{
ACE_TRACE ("ACE_Remote_Name_Space::list_name_entries");
ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> pattern_urep (pattern.rep ());
ACE_UINT32 pattern_len =
static_cast<ACE_UINT32> (pattern.length () * sizeof (ACE_WCHAR_T));
ACE_Name_Request request (ACE_Name_Request::LIST_NAME_ENTRIES,
pattern_urep.get (),
pattern_len,
0, 0, 0, 0);
if (this->ns_proxy_.send_request (request) == -1)
return -1;
ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0);
while (reply.msg_type () != ACE_Name_Request::MAX_ENUM)
{
if (this->ns_proxy_.recv_reply (reply) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
ACE_LIB_TEXT ("%p\n"),
ACE_LIB_TEXT ("ACE_Remote_Name_Space::list_names")),
-1);
if (reply.msg_type () != ACE_Name_Request::MAX_ENUM)
{
ACE_NS_WString name (reply.name (),
reply.name_len () / sizeof (ACE_WCHAR_T));
ACE_NS_WString value (reply.value (),
reply.value_len () / sizeof (ACE_WCHAR_T));
ACE_Name_Binding entry (name,
value,
reply.type ());
if (set.insert (entry) == -1)
return -1;
}
}
return 0;
}
示例8: ACE_ERROR_RETURN
int
Client_Test::list_types (const char *pattern)
{
ACE_PWSTRING_SET set;
if (NAMING_CONTEXT ()->list_types (set, pattern) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"%p Pattern matching failed!\n",
"Client_Test::list_types"),
0);
else
{
ACE_PWSTRING_ITERATOR set_iterator (set);
for (ACE_NS_WString *type = 0;
set_iterator.next (type) !=0;
set_iterator.advance())
ACE_DEBUG ((LM_DEBUG,
"%s\n",
type->char_rep ()));
}
return 0;
}