本文整理汇总了C++中VString::fi方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::fi方法的具体用法?C++ VString::fi怎么用?C++ VString::fi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VString
的用法示例。
在下文中一共展示了VString::fi方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fsize_fmt
VString fsize_fmt( fsize_t fs, bool full ) /* return commified number */
{
VString str;
if (!full && fs > 99999999999.0 ) // 99_999_999_999 11 positions + 3 comma = 14 chars
{
str.fi( int( fs / ( 1024*1024 ) ) );
str_comma( str );
str += " MiB";
}
else
{
str.fi( fs );
str_comma( str );
}
return str;
}
示例2: tree_draw_pos
void tree_draw_pos( ScrollPos &scroll, int opos )
{
int z = scroll.pos() - scroll.page();
if ( opos != -1 ) tree_draw_item( scroll.page(), opos );
tree_draw_item( scroll.page(), z, 1 );
VString str;
str = dir_tree[scroll.pos()];
str_tr( str,"\\", "/" );
VString sz;
sz.fi( size_cache_get( str ) );
str_comma( sz );
str_pad( sz, 14 );
str = sz + " " + str;
str = str_dot_reduce( str, con_max_x()-1 );
say1( str, cINFO );
say2( " Help: R Rebuild, S Incremental search, Z Recalc directory size", cINFO );
show_pos( scroll.pos()+1, scroll.max()+1 );
}
示例3: tree_draw_item
void tree_draw_item( int page, int index, int hilite )
{
if ( page + index >= dir_tree.count() ) return;
VString s1 = dir_tree[page+index];
str_trim_right(s1,1);
VString s2 = s1;
int j = str_rfind( s1,'/');
str_trim_right(s1,str_len(s2)-j-1);
str_trim_left(s2,j+1);
for(j = 0; j < str_len(s1); j++)
{
if (s1[j] == '/')
str_set_ch(s1,j, '|');
else
if (s1[j] == '\\')
str_set_ch(s1,j, '\\');
else
str_set_ch(s1,j, '+');
}
if (opt.tree_compact)
{
str_replace(s1,"+", "");
str_replace(s1,"|", "| ");
str_replace(s1,"\\"," ");
str_trim_right(s1,2);
s1 += "--";
}
else
{
str_replace(s1,"+", " ");
str_replace(s1,"\\", " ");
s1 += "--";
}
VString str = dir_tree[page+index];
str_tr( str,"\\", "/" );
VString sz;
sz.fi( size_cache_get( str ) );
if ( sz == "-1" )
sz = "n/a";
else
str_comma( sz );
str_pad( sz, 14 );
s1 = sz + " " + s1;
int m = con_max_x() - 1; /* doesn't speed the code... :) */
if ( str_len( s1 ) > m )
{
str_sleft( s1, m );
s2 = "";
}
else if ( str_len( s1 ) + str_len( s2 ) > m )
{
str_sleft( s2, m - str_len( s1 ) );
}
con_xy(1,3+1+index);
if (hilite)
{
con_puts( s1, cBAR );
con_puts( s2, cBAR );
con_ce( cBAR );
}
else
{
con_puts( s1, cSTATUS );
con_puts( s2, cMESSAGE );
con_ce( cSTATUS );
}
}