本文整理汇总了C++中file_info::meta_remove_field方法的典型用法代码示例。如果您正苦于以下问题:C++ file_info::meta_remove_field方法的具体用法?C++ file_info::meta_remove_field怎么用?C++ file_info::meta_remove_field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类file_info
的用法示例。
在下文中一共展示了file_info::meta_remove_field方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_tag
void embeddedcue_metadata_manager::get_tag(file_info & p_info) const {
if (!have_cuesheet()) {
m_content.query_ptr((unsigned)0)->m_info.to_info(p_info);
p_info.meta_remove_field("cuesheet");
} else {
cue_creator::t_entry_list entries;
m_content.enumerate(__get_tag_cue_track_list_builder(entries));
pfc::string_formatter cuesheet;
cue_creator::create(cuesheet,entries);
entries.remove_all();
//parse it back to see what info got stored in the cuesheet and what needs to be stored outside cuesheet in the tags
cue_parser::parse_full(cuesheet,entries);
file_info_record output;
{
file_info_record::t_meta_map globals;
//1. find global infos and forward them
{
field_name_list fields;
m_content.enumerate(__get_tag__enum_fields_enumerator(fields));
fields.enumerate(__get_tag__filter_globals(m_content,globals));
}
output.overwrite_meta(globals);
//2. find local infos
m_content.enumerate(__get_tag__local_field_filter(globals,output.m_meta));
}
//strip redundant titles and tracknumbers that the cuesheet already contains
for(cue_creator::t_entry_list::const_iterator iter = entries.first(); iter.is_valid(); ++iter) {
strip_redundant_track_meta(iter->m_track_number,iter->m_infos,output.m_meta,"tracknumber");
strip_redundant_track_meta(iter->m_track_number,iter->m_infos,output.m_meta,"title");
}
//add tech infos etc
{
const track_record * rec = m_content.query_ptr((unsigned)0);
if (rec != NULL) {
output.set_length(rec->m_info.get_length());
output.set_replaygain(rec->m_info.get_replaygain());
output.overwrite_info(rec->m_info.m_info);
}
}
output.meta_set("cuesheet",cuesheet);
output.to_info(p_info);
}
}
示例2: apply_filter
bool TagWriter::apply_filter(metadb_handle_ptr p_location, t_filestats p_stats, file_info & p_info) {
try {
auto tags = files[p_location];
for (auto tag = tags.first(); tag.is_valid(); tag++) {
// TODO: return false if all info is identical
p_info.meta_remove_field(tag->m_key);
// TODO: text multivalues
tag->m_value.for_each([&](pfc::string8 &value) {
if (!value.is_empty()) {
p_info.meta_add(tag->m_key, value);
}
});
}
return true;
} catch (pfc::exception_map_entry_not_found) {
return false;
}
}