本文整理汇总了C++中pfc::string_base::set_string方法的典型用法代码示例。如果您正苦于以下问题:C++ string_base::set_string方法的具体用法?C++ string_base::set_string怎么用?C++ string_base::set_string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pfc::string_base
的用法示例。
在下文中一共展示了string_base::set_string方法的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_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!");
}
示例3: remove_chars
void remove_chars( const char* p_src , pfc::string_base& p_out , const char* p_char)
{
const char* p = p_char;
pfc::string8 temp(p_src);
const char* p2 = temp.get_ptr();
for (;*p;)
{
unsigned test;
t_size delta = pfc::utf8_decode_char(p,test);
if(delta == 0 || test == 0)break;
for (;*p2;)
{
unsigned test2;
t_size delta2 = pfc::utf8_decode_char(p2,test2);
if(delta2 == 0 || test2 == 0)break;
if( test == test2 ){
temp.remove_chars(p2-temp.get_ptr(),delta2);
}
else{
p2 += delta2;
}
}
p2 = temp.get_ptr();
p += delta;
}
p_out.set_string(temp);
}
示例4: 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());
}
示例5: uGetItemText
void CDialogPref::uGetItemText(int nItem, int nSubItem, pfc::string_base & out)
{
enum { BUFFER_LEN = 1024 };
TCHAR buffer[BUFFER_LEN];
m_props.GetItemText(nItem, nSubItem, buffer, BUFFER_LEN);
out.set_string(pfc::stringcvt::string_utf8_from_os(buffer));
}
示例6: g_parse_unpack_path_ex
bool archive_impl::g_parse_unpack_path_ex(const char * path,pfc::string_base & archive,pfc::string_base & file, pfc::string_base & type) {
PFC_ASSERT( g_is_unpack_path(path) );
const char * base = path + unpack_prefix_len; // strstr(path, "//");
const char * split = strchr(path,'|');
if (base == NULL || split == NULL || base > split) return false;
// base += 2;
type.set_string( base, split - base );
int delta = path_unpack_string(archive,split);
if (delta<0) return false;
split += delta;
file = split;
return true;
}
示例7: get_name
virtual void get_name(t_uint32 p_index,pfc::string_base & p_out)
{
switch ( p_index )
{
case CMD_NOTITLE:
p_out.set_string( "Hide Title Bar" );
break;
case CMD_SAVE_1:
case CMD_SAVE_2:
case CMD_SAVE_3:
case CMD_SAVE_4:
case CMD_SAVE_5:
{
int n = p_index - CMD_SAVE_1;
p_out.set_string( pfc::string_printf( "save %s",
names[n]->get_ptr() ) );
}
break;
case CMD_REST_1:
case CMD_REST_2:
case CMD_REST_3:
case CMD_REST_4:
case CMD_REST_5:
{
int n = p_index - CMD_REST_1;
p_out.set_string( pfc::string_printf( "restore %s",
names[n]->get_ptr() ) );
}
break;
case CMD_SCRIPT1:
p_out.set_string( "->Big View" );
break;
case CMD_SCRIPT2:
p_out.set_string( "->Small View" );
break;
}
}
示例8: relative_path_create
bool archive_impl::relative_path_create(const char * file_path,const char * playlist_path,pfc::string_base & out) {
pfc::string8 archive,file;
if (g_parse_unpack_path(file_path,archive,file))
{
pfc::string8 archive_rel;
if (g_relative_path_create(archive,playlist_path,archive_rel))
{
pfc::string8 out_path;
make_unpack_path(out_path,archive_rel,file);
out.set_string(out_path);
return true;
}
}
return false;
}
示例9: relative_path_parse
bool archive_impl::relative_path_parse(const char * relative_path,const char * playlist_path,pfc::string_base & out)
{
if (!is_our_path(relative_path)) return false;
pfc::string8 archive_rel,file;
if (g_parse_unpack_path(relative_path,archive_rel,file))
{
pfc::string8 archive;
if (g_relative_path_parse(archive_rel,playlist_path,archive))
{
pfc::string8 out_path;
make_unpack_path(out_path,archive,file);
out.set_string(out_path);
return true;
}
}
return false;
}
示例10: path_unpack_string
static int path_unpack_string(pfc::string_base & out,const char * src)
{
int ptr=0;
if (src[ptr++]!='|') return -1;
int len = atoi(src+ptr);
if (len<=0) return -1;
while(src[ptr]!=0 && src[ptr]!='|') ptr++;
if (src[ptr]!='|') return -1;
ptr++;
int start = ptr;
while(ptr-start<len)
{
if (src[ptr]==0) return -1;
ptr++;
}
if (src[ptr]!='|') return -1;
out.set_string(&src[start],len);
ptr++;
return ptr;
}
示例11: read_string_ex
void stream_reader::read_string_ex(pfc::string_base & p_out,t_size p_bytes,abort_callback & p_abort) {
const t_size expBase = 64*1024;
if (p_bytes > expBase) {
pfc::array_t<char> temp;
t_size allocWalk = expBase;
t_size done = 0;
for(;;) {
const t_size target = pfc::min_t(allocWalk, p_bytes);
temp.set_size(target);
read_object(temp.get_ptr() + done, target - done, p_abort);
if (target == p_bytes) break;
done = target;
allocWalk <<= 1;
}
p_out.set_string(temp.get_ptr(), p_bytes);
} else {
pfc::string_buffer buf(p_out, p_bytes);
read_object(buf.get_ptr(),p_bytes,p_abort);
}
}
示例12: get_name
void menu_extension::get_name(pfc::string_base & out)const
{
out.set_string("Menu");
}
示例13: get_name
void example_window::get_name(pfc::string_base & out)const
{
out.set_string("Example");
}
示例14: get_category
void example_window::get_category(pfc::string_base & out)const
{
out.set_string("Panels");
}
示例15: get_name
void spectrum_extension::get_name(pfc::string_base & out)const
{
out.set_string("Spectrum analyser");
}