本文整理汇总了C++中ACE_NS_WString::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_NS_WString::resize方法的具体用法?C++ ACE_NS_WString::resize怎么用?C++ ACE_NS_WString::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_NS_WString
的用法示例。
在下文中一共展示了ACE_NS_WString::resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: object
int
ACE_Registry_Name_Space::resolve (const ACE_NS_WString &name,
ACE_NS_WString &value,
char *&type)
{
ACE_UNUSED_ARG(type);
// This object will be used to query the size of the data.
// Note: The query_object.data will be null for this invocation.
ACE_Registry::Object query_object;
int result =
#if defined (ACE_USES_WCHAR)
this->context_.resolve (name.fast_rep (), query_object);
#else
this->context_.resolve (name.char_rep (), query_object);
#endif /* ACE_USES_WCHAR */
if (result != 0)
return result;
// Resize the value passed by the user
// Note: -1 is used because the size includes the null terminator
value.resize ((query_object.size () - 1) / sizeof (ACE_WSTRING_TYPE));
// Represent new space as an ACE_Registry::Object
ACE_Registry::Object object ((void *) value.fast_rep (),
query_object.size (),
REG_SZ);
#if defined (ACE_USES_WCHAR)
result = this->context_.resolve (name.fast_rep (), object);
#else
result = this->context_.resolve (name.char_rep (), object);
#endif /* ACE_USES_WCHAR */
if (object.size () != query_object.size ())
return -1;
if (result != 0)
return result;
return 0;
}