本文整理汇总了C++中pfc::string_base类的典型用法代码示例。如果您正苦于以下问题:C++ string_base类的具体用法?C++ string_base怎么用?C++ string_base使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了string_base类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_description
virtual bool get_description(t_uint32 p_index,pfc::string_base & p_out)
{
switch ( p_index )
{
case CMD_NOTITLE:
p_out.set_string( "Hide the main window title bar" );
return true;
case CMD_SAVE_1:
case CMD_SAVE_2:
case CMD_SAVE_3:
case CMD_SAVE_4:
case CMD_SAVE_5:
{
p_out.set_string( "save current screen location to a slot" );
return true;
}
break;
case CMD_REST_1:
case CMD_REST_2:
case CMD_REST_3:
case CMD_REST_4:
case CMD_REST_5:
{
p_out.set_string( "restore screen location from a slot" );
return true;
}
break;
case CMD_SCRIPT1:
case CMD_SCRIPT2:
p_out.set_string( "Change the layout and size" );
return true;
}
return false;
}
示例2: 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());
}
示例3: urlEncodeAppendRaw
void urlEncodeAppendRaw(pfc::string_base & out, const char * in, t_size inSize) {
for(t_size walk = 0; walk < inSize; ++walk) {
const char c = in[walk];
if (c == ' ') out.add_byte('+');
else if (pfc::char_is_ascii_alphanumeric(c) || c == '_') out.add_byte(c);
else out << "%" << pfc::format_hex((t_uint8)c, 2);
}
}
示例4: 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]));
}
示例5: path_pack_string
static void path_pack_string(pfc::string_base & out,const char * src)
{
out.add_char('|');
out << strlen(src);
out.add_char('|');
out << src;
out.add_char('|');
}
示例6: urlEncodeAppend
void urlEncodeAppend(pfc::string_base & out, const char * in) {
for(;;) {
const char c = *(in++);
if (c == 0) break;
else if (c == ' ') out.add_byte('+');
else if (pfc::char_is_ascii_alphanumeric(c) || c == '_') out.add_byte(c);
else out << "%" << pfc::format_hex((t_uint8)c, 2);
}
}
示例7: 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;
}
}
示例8: 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;
}
示例9: get_display_path
bool archive_impl::get_display_path(const char * path,pfc::string_base & out)
{
pfc::string8 archive,file;
if (g_parse_unpack_path(path,archive,file))
{
g_get_display_path(archive,out);
out.add_string("|");
out.add_string(file);
return true;
}
else return false;
}
示例10: 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;
}
}
示例11: get_display_name
void playlist_view_cache::get_display_name(unsigned playlist, unsigned idx, int col, pfc::string_base & out)
{
playlist_cache * p_cache = get_item(playlist);
if (idx >= 0 && idx < p_cache->get_count())
{
if (!p_cache->get_item(idx))
{
if (!update_item(playlist, idx)) {out.set_string("Error"); return;}
}
p_cache->get_item(idx)->get_item(col)->get_display(out); return;
}
out.set_string("Internal error - invalid playlist entry!");
}
示例12: 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++);
}
}
示例13: 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);
}
}
}
}
示例14: 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;
}
示例15: 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;
}