本文整理汇总了C++中file_info::info_get方法的典型用法代码示例。如果您正苦于以下问题:C++ file_info::info_get方法的具体用法?C++ file_info::info_get怎么用?C++ file_info::info_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file_info
的用法示例。
在下文中一共展示了file_info::info_get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: from_infos
bool t_cuesheet_index_list::from_infos(file_info const & p_in,double p_base)
{
double pregap;
bool found = false;
if (!parse_value(p_in.info_get("pregap"),pregap)) pregap = 0;
else found = true;
m_positions[0] = p_base - pregap;
m_positions[1] = p_base;
for(unsigned n=2;n<count;n++)
{
char namebuffer[16];
sprintf_s(namebuffer,"index %02u",n);
double temp;
if (parse_value(p_in.info_get(namebuffer),temp)) {
m_positions[n] = temp + p_base; found = true;
} else {
m_positions[n] = 0;
}
}
return found;
}
示例2: _add_tag
void file_info::_add_tag(const file_info & otherTag) {
this->set_replaygain( replaygain_info::g_merge( this->get_replaygain(), otherTag.get_replaygain() ) );
const char * tt1 = this->info_get(_tagtype);
const char * tt2 = otherTag.info_get(_tagtype);
if (tt2) {
if (tt1) {
this->info_set(_tagtype, PFC_string_formatter() << tt1 << "|" << tt2);
} else {
this->info_set(_tagtype, tt2);
}
}
}
示例3: strtoul
write_xid6( service_ptr_t<file> & p_file, const file_info & p_info, abort_callback & p_abort )
: m_file( p_file ), m_abort( p_abort )
{
pfc::stringcvt::string_ansi_from_utf8 converter;
t_filesize offset_tag_start;
const char * value;
t_uint32 int32 = 0;
p_file->seek_ex( 0, file::seek_from_eof, p_abort );
p_file->write_object( xid6_signature, 4, p_abort );
p_file->write_object_t( int32, p_abort );
offset_tag_start = p_file->get_position( p_abort );
value = p_info.meta_get( "title", 0 );
if ( value )
{
converter.convert( value );
if ( strlen( converter ) > 32 ) write_string( XID_SONG, converter );
}
value = p_info.meta_get( "album", 0 );
if ( value )
{
converter.convert( value );
if ( strlen( converter ) > 32 ) write_string( XID_GAME, converter );
}
value = p_info.meta_get( "artist", 0 );
if ( value )
{
converter.convert( value );
if ( strlen( converter ) > 32 ) write_string( XID_ARTIST, converter );
}
value = p_info.meta_get( "dumper", 0 );
if ( value )
{
converter.convert( value );
if ( strlen( converter ) > 16 ) write_string( XID_DUMPER, converter );
}
value = p_info.meta_get( "comment", 0 );
if ( value )
{
converter.convert( value );
if ( strlen( converter ) > 32 ) write_string( XID_CMNTS, converter );
}
value = p_info.meta_get( "OST", 0 );
if ( value )
{
converter.convert( value );
write_string( XID_OST, converter );
}
value = p_info.meta_get( "discnumber", 0 );
if ( value )
{
char * end;
unsigned disc = strtoul( value, &end, 10 );
if ( !*end && disc > 0 && disc <= 9 )
write_data( XID_DISC, disc );
}
value = p_info.meta_get( "tracknumber", 0 );
if ( value )
{
char * end;
unsigned track = strtoul( value, &end, 10 );
if ( track > 0 && track < 100 )
write_data( XID_TRACK, track * 0x100 + *end );
}
value = p_info.meta_get( "copyright", 0 );
if ( value )
{
char * end;
unsigned copyright_year = strtoul( value, &end, 10 );
if ( copyright_year > 0 && copyright_year < 65536 )
write_data( XID_COPY, copyright_year );
while ( *end && *end == ' ' ) end++;
if ( *end )
{
converter.convert( end );
write_string( XID_PUB, converter );
}
}
value = p_info.info_get( field_length );
if ( value )
{
char * end;
unsigned length = strtoul( value, &end, 10 );
if ( !*end && length > 0 && ( length % 1000 || length > 999000 ) )
write_int( XID_INTRO, length * 64 );
}
//.........这里部分代码省略.........
示例4: offsetof
static void write_id666( service_ptr_t<file> & p_file, const file_info & p_info, abort_callback & p_abort )
{
char buffer[32];
const char * value;
pfc::stringcvt::string_ansi_from_utf8 converter;
p_file->seek( 0x23, p_abort );
buffer [0] = 26;
p_file->write_object( buffer, 1, p_abort );
p_file->seek( offsetof( Spc_Emu::header_t, song ), p_abort );
memset( buffer, 0, sizeof( buffer ) );
value = p_info.meta_get( "title", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 32 );
}
p_file->write_object( buffer, 32, p_abort );
memset( buffer, 0, sizeof( buffer ) );
value = p_info.meta_get( "album", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 32 );
}
p_file->write_object( buffer, 32, p_abort );
memset( buffer, 0, 16 );
value = p_info.meta_get( "dumper", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 16 );
}
p_file->write_object( buffer, 16, p_abort );
memset( buffer, 0, sizeof( buffer ) );
value = p_info.meta_get( "comment", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 32 );
}
p_file->write_object( buffer, 32, p_abort );
memset( buffer, 0, 11 );
value = p_info.meta_get( "date", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 11 );
}
p_file->write_object( buffer, 11, p_abort );
memset( buffer, 0, 3 );
value = p_info.info_get( field_length );
if ( value )
{
size_t length = strlen( value );
if ( length > 3 )
{
length -= 3;
strncpy( buffer, value, min( 3, length ) );
}
}
p_file->write_object( buffer, 3, p_abort );
memset( buffer, 0, 5 );
value = p_info.info_get( field_fade );
if ( value ) strncpy( buffer, value, 5 );
p_file->write_object( buffer, 5, p_abort );
memset( buffer, 0, sizeof( buffer ) );
value = p_info.meta_get( "artist", 0 );
if ( value )
{
converter.convert( value );
strncpy( buffer, converter, 32 );
}
p_file->write_object( buffer, 32, p_abort );
}
示例5: _set_tag
void file_info::_set_tag(const file_info & tag) {
this->copy_meta(tag);
this->set_replaygain( replaygain_info::g_merge( this->get_replaygain(), tag.get_replaygain() ) );
const char * tt = tag.info_get(_tagtype);
if (tt) this->info_set(_tagtype, tt);
}