本文整理汇总了C++中pfc::string_base::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ string_base::reset方法的具体用法?C++ string_base::reset怎么用?C++ string_base::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pfc::string_base
的用法示例。
在下文中一共展示了string_base::reset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: context_get_description
bool menu_helpers::context_get_description(const GUID& p_guid,pfc::string_base & out) {
service_ptr_t<contextmenu_item> ptr; t_uint32 index;
if (!menu_item_resolver::g_resolve_context_command(p_guid, ptr, index)) return false;
bool rv = ptr->get_item_description(index, out);
if (!rv) out.reset();
return rv;
}
示例2: meta_format
bool file_info::meta_format(const char * p_name,pfc::string_base & p_out, const char * separator) const {
p_out.reset();
t_size index = meta_find(p_name);
if (index == pfc_infinite) return false;
meta_format_entry(index, p_out, separator);
return true;
}
示例3: if
void toolbar_extension::button::get_name(pfc::string_base & p_out) //config
{
p_out.reset();
if (m_type == TYPE_BUTTON)
{
p_out = "[Button] ";
pfc::string8 temp;
if (uie::custom_button::g_button_get_name(m_guid, temp))
{
p_out += temp;
}
}
else if (m_type == TYPE_SEPARATOR)
p_out = "[Separator]";
else if (m_type == TYPE_MENU_ITEM_MAIN)
{
pfc::string8 temp;
p_out = "[Main menu item] ";
menu_helpers::mainpath_from_guid(m_guid, m_subcommand, temp);
p_out += temp;
}
else
{
pfc::string8 temp;
menu_helpers::contextpath_from_guid(m_guid, m_subcommand, temp);
p_out = "[Shortcut menu item] ";
p_out += temp;
}
}
示例4: maingroupname_from_guid
bool maingroupname_from_guid(const GUID & p_guid, pfc::string_base & p_out, GUID & parentout)
{
p_out.reset();
parentout = pfc::guid_null;
{
service_enum_t<mainmenu_group> e;
service_ptr_t<mainmenu_group> ptr;
service_ptr_t<mainmenu_group_popup> ptrp;
//unsigned p_service_item_index;
while (e.next(ptr))
{
{
if (ptr->get_guid() == p_guid)
{
parentout = ptr->get_parent();
if (ptr->service_query_t(ptrp))
{
ptrp->get_display_string(p_out);
return true;
}
return false;
}
}
}
}
return false;
}
示例5:
void toolbar_extension::button::get_display_text(pfc::string_base & p_out) //display
{
p_out.reset();
if (m_use_custom_text)
p_out = m_text;
else
get_short_name(p_out);
}
示例6: get_default_script_code
void wsh_panel_vars::get_default_script_code(pfc::string_base & out)
{
out.reset();
puResource pures = uLoadResource(core_api::get_my_instance(), uMAKEINTRESOURCE(IDR_SCRIPT), "SCRIPT");
if (pures)
out.set_string(reinterpret_cast<const char *>(pures->GetPointer()), pures->GetSize());
}
示例7: insert
void insert(const char * src,unsigned idx,pfc::string_base & out)
{
out.reset();
out.add_string(src,idx);
out.add_string("&");
out.add_string(src+idx);
used.add_char(uCharLower(src[idx]));
}
示例8: meta_format_entry
void file_info::meta_format_entry(t_size index, pfc::string_base & out, const char * separator) const {
out.reset();
t_size val, count = meta_enum_value_count(index);
PFC_ASSERT( count > 0);
for(val=0; val<count; val++)
{
if (val > 0) out += separator;
out += meta_enum_value(index,val);
}
}
示例9: format_title_legacy
bool metadb_handle::format_title_legacy(titleformat_hook * p_hook,pfc::string_base & p_out,const char * p_spec,titleformat_text_filter * p_filter)
{
service_ptr_t<titleformat_object> script;
if (static_api_ptr_t<titleformat_compiler>()->compile(script,p_spec)) {
return format_title(p_hook,p_out,script,p_filter);
} else {
p_out.reset();
return false;
}
}
示例10: get_mask
virtual bool get_mask(unsigned idx, pfc::string_base & out)
{
if (idx > 0) return false;
out.reset();
for (int n = 0; n < 14; n++)
{
if (n) out.add_byte(';');
out << "*." << extensions[n];
}
return true;
}
示例11: winPrefixPath
void pfc::winPrefixPath(pfc::string_base & out, const char * p_path) {
const char * prepend_header = "\\\\?\\";
const char * prepend_header_net = "\\\\?\\UNC\\";
if (pfc::strcmp_partial( p_path, prepend_header ) == 0) { out = p_path; return; }
out.reset();
if (pfc::strcmp_partial(p_path,"\\\\") != 0) {
out << prepend_header << p_path;
} else {
out << prepend_header_net << (p_path+2);
}
};
示例12: read_string_raw
void stream_reader::read_string_raw(pfc::string_base & p_out,abort_callback & p_abort) {
enum {delta = 256};
char buffer[delta];
p_out.reset();
for(;;) {
t_size delta_done;
delta_done = read(buffer,delta,p_abort);
p_out.add_string(buffer,delta_done);
if (delta_done < delta) break;
}
}
示例13: chars_to_lower
void chars_to_lower( const char* p_src , pfc::string_base& p_out )
{
p_out.reset();
const char* p = p_src;
for (;*p;)
{
unsigned test;
t_size delta = pfc::utf8_decode_char(p,test);
if( delta == 0 || test == 0 ) break;
p_out.add_char(pfc::charLower(test));
p+=delta;
}
}
示例14: remove_color_marks
void titleformat_compiler::remove_color_marks(const char * src,pfc::string_base & out)//helper
{
out.reset();
while(*src)
{
if (*src==3)
{
src++;
while(*src && *src!=3) src++;
if (*src==3) src++;
}
else out.add_byte(*src++);
}
}
示例15: mainpath_from_guid
void mainpath_from_guid(const GUID & p_guid, const GUID & p_subguid, pfc::string_base & p_out, bool b_short)
{
p_out.reset();
service_enum_t<mainmenu_commands> e;
service_ptr_t<mainmenu_commands> ptr;
unsigned p_service_item_index;
while (e.next(ptr))
{
service_ptr_t<mainmenu_commands_v2> ptr_v2;
ptr->service_query_t(ptr_v2);
unsigned p_service_item_count = ptr->get_command_count();
for (p_service_item_index = 0; p_service_item_index < p_service_item_count; p_service_item_index++)
{
if (p_guid == ptr->get_command(p_service_item_index))
{
pfc::string8 name;
ptr->get_name(p_service_item_index, name);
if (p_subguid != pfc::guid_null && ptr_v2.is_valid() && ptr_v2->is_command_dynamic(p_service_item_index))
{
pfc::string8 name_sub;
mainmenu_node::ptr ptr_node = ptr_v2->dynamic_instantiate(p_service_item_index);
mainmenunode_subguid_to_path(ptr_node, p_subguid, name_sub, true);
name << "/" << name_sub;
}
if (!b_short)
{
pfc::list_t<pfc::string8> levels;
GUID parent = ptr->get_parent();
while (parent != pfc::guid_null)
{
pfc::string8 parentname;
if (maingroupname_from_guid(GUID(parent), parentname, parent))
levels.insert_item(parentname, 0);
}
unsigned i, count = levels.get_count();
for (i = 0; i<count; i++)
{
p_out.add_string(levels[i]);
p_out.add_byte('/');
}
}
p_out.add_string(name);
}
}
}
}