当前位置: 首页>>代码示例>>C++>>正文


C++ file_info::info_get_count方法代码示例

本文整理汇总了C++中file_info::info_get_count方法的典型用法代码示例。如果您正苦于以下问题:C++ file_info::info_get_count方法的具体用法?C++ file_info::info_get_count怎么用?C++ file_info::info_get_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在file_info的用法示例。


在下文中一共展示了file_info::info_get_count方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: copy_info

void file_info::copy_info(const file_info & p_source)
{
    if (&p_source != this) {
        info_remove_all();
        t_size n, m = p_source.info_get_count();
        for(n=0; n<m; n++)
            copy_info_single_nocheck(p_source,n);
    }
}
开发者ID:kazukioishi,项目名称:foo_nowplayingtunes,代码行数:9,代码来源:file_info.cpp

示例2: g_is_info_equal

bool file_info::g_is_info_equal(const file_info & p_item1,const file_info & p_item2) {
    t_size count = p_item1.info_get_count();
    if (count != p_item2.info_get_count()) {
        //uDebugLog() << "info count mismatch";
        return false;
    }
    for(t_size n1=0; n1<count; n1++) {
        t_size n2 = p_item2.info_find(p_item1.info_enum_name(n1));
        if (n2 == pfc_infinite) {
            //uDebugLog() << "item2 does not have " << p_item1.info_enum_name(n1);
            return false;
        }
        if (strcmp(p_item1.info_enum_value(n1),p_item2.info_enum_value(n2)) != 0) {
            //uDebugLog() << "value mismatch: " << p_item1.info_enum_name(n1);
            return false;
        }
    }
    return true;
}
开发者ID:kazukioishi,项目名称:foo_nowplayingtunes,代码行数:19,代码来源:file_info.cpp

示例3: merge_fallback

void file_info::merge_fallback(const file_info & source) {
	set_replaygain( replaygain_info::g_merge(get_replaygain(), source.get_replaygain() ) );
	if (get_length() <= 0) set_length(source.get_length());
	t_size count = source.info_get_count();
	for(t_size infoWalk = 0; infoWalk < count; ++infoWalk) {
		const char * name = source.info_enum_name(infoWalk);
		if (!info_exists(name)) __info_add_unsafe(name, source.info_enum_value(infoWalk));
	}
	count = source.meta_get_count();
	for(t_size metaWalk = 0; metaWalk < count; ++metaWalk) {
		const char * name = source.meta_enum_name(metaWalk);
		if (!meta_exists(name)) _copy_meta_single_nocheck(source, metaWalk);
	}
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:14,代码来源:file_info_merge.cpp

示例4: copy

void file_info_const_impl::copy(const file_info & p_source)
{
//	profiler(file_info_const_impl__copy);
	t_size meta_size = 0;
	t_size info_size = 0;
	t_size valuemap_size = 0;
	t_size stringbuffer_size = 0;
#ifdef __file_info_const_impl_have_hintmap__
	t_size hintmap_size = 0;
#endif

	{
//		profiler(file_info_const_impl__copy__pass1);
		t_size index;
		m_meta_count = pfc::downcast_guarded<t_index>(p_source.meta_get_count());
		meta_size = m_meta_count * sizeof(meta_entry);
#ifdef __file_info_const_impl_have_hintmap__
		hintmap_size = (m_meta_count > hintmap_cutoff) ? m_meta_count * sizeof(t_index) : 0;
#endif//__file_info_const_impl_have_hintmap__
		for(index = 0; index < m_meta_count; index++ )
		{
			{
				const char * name = p_source.meta_enum_name(index);
				if (optimize_fieldname(name) == 0)
					stringbuffer_size += strlen(name) + 1;
			}

			t_size val; const t_size val_max = p_source.meta_enum_value_count(index);
			
			if (val_max == 1)
			{
				stringbuffer_size += strlen(p_source.meta_enum_value(index,0)) + 1;
			}
			else
			{
				valuemap_size += val_max * sizeof(char*);

				for(val = 0; val < val_max; val++ )
				{
					stringbuffer_size += strlen(p_source.meta_enum_value(index,val)) + 1;
				}
			}
		}

		m_info_count = pfc::downcast_guarded<t_index>(p_source.info_get_count());
		info_size = m_info_count * sizeof(info_entry);
		for(index = 0; index < m_info_count; index++ )
		{
			const char * name = p_source.info_enum_name(index);
			if (optimize_infoname(name) == NULL) stringbuffer_size += strlen(name) + 1;
			stringbuffer_size += strlen(p_source.info_enum_value(index)) + 1;
		}
	}


	{
//		profiler(file_info_const_impl__copy__alloc);
		m_buffer.set_size(
#ifdef __file_info_const_impl_have_hintmap__
			hintmap_size + 
#endif
			meta_size + info_size + valuemap_size + stringbuffer_size);
	}

	char * walk = m_buffer.get_ptr();

#ifdef __file_info_const_impl_have_hintmap__
	t_index* hintmap = (hintmap_size > 0) ? (t_index*) walk : NULL;
	walk += hintmap_size;
#endif
	meta_entry * meta = (meta_entry*) walk;
	walk += meta_size;
	char ** valuemap = (char**) walk;
	walk += valuemap_size;
	info_entry * info = (info_entry*) walk;
	walk += info_size;
	char * stringbuffer = walk;

	m_meta = meta;
	m_info = info;
#ifdef __file_info_const_impl_have_hintmap__
	m_hintmap = hintmap;
#endif

	{
//		profiler(file_info_const_impl__copy__pass2);
		t_size index;
		for( index = 0; index < m_meta_count; index ++ )
		{
			t_size val; const t_size val_max = p_source.meta_enum_value_count(index);

			{
				const char * name = p_source.meta_enum_name(index);
				const char * name_opt = optimize_fieldname(name);
				if (name_opt == NULL)
					meta[index].m_name = stringbuffer_append(stringbuffer, name );
				else
					meta[index].m_name = name_opt;
			}
			
//.........这里部分代码省略.........
开发者ID:georgemouse,项目名称:foobar2000-Vorbis-Streamer-v1.1-mouse_fix-,代码行数:101,代码来源:file_info_const_impl.cpp

示例5: overwrite_info

void file_info::overwrite_info(const file_info & p_source) {
	t_size count = p_source.info_get_count();
	for(t_size n=0;n<count;n++) {
		info_set(p_source.info_enum_name(n),p_source.info_enum_value(n));
	}
}
开发者ID:Irwin1138,项目名称:foo_bestversion,代码行数:6,代码来源:file_info_merge.cpp


注:本文中的file_info::info_get_count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。