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


C++ metadb_handle_list_cref::get_item_ex方法代码示例

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


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

示例1: sort_by_relative_path_get_order

void metadb_handle_list_helper::sort_by_relative_path_get_order(metadb_handle_list_cref p_list,t_size* order)
{
	const t_size count = p_list.get_count();
	t_size n;
	pfc::array_t<custom_sort_data> data;
	data.set_size(count);
	static_api_ptr_t<library_manager> api;
	
	pfc::string8_fastalloc temp;
	temp.prealloc(512);
	for(n=0;n<count;n++)
	{
		metadb_handle_ptr item;
		p_list.get_item_ex(item,n);
		if (!api->get_relative_path(item,temp)) temp = "";
		data[n].index = n;
		data[n].text = makeSortString(temp);
		//data[n].subsong = item->get_subsong_index();
	}

	pfc::sort_t(data,custom_sort_compare<1>,count);
	//qsort(data.get_ptr(),count,sizeof(custom_sort_data),(int (__cdecl *)(const void *elem1, const void *elem2 ))custom_sort_compare);

	for(n=0;n<count;n++)
	{
		order[n]=data[n].index;
		delete[] data[n].text;
	}
}
开发者ID:exscape,项目名称:foo_simpleserver,代码行数:29,代码来源:metadb_handle_list.cpp

示例2: calc_total_size

t_filesize metadb_handle_list_helper::calc_total_size(metadb_handle_list_cref p_list, bool skipUnknown) {
	pfc::avltree_t< const char*, metadb::path_comparator > beenHere;
//	metadb_handle_list list(p_list);
//	list.sort_t(metadb::path_compare_metadb_handle);

	t_filesize ret = 0;
	t_size n, m = p_list.get_count();
	for(n=0;n<m;n++) {
		bool isNew;
		metadb_handle_ptr h; p_list.get_item_ex(h, n);
		beenHere.add_ex( h->get_path(), isNew);
		if (isNew) {
			t_filesize t = h->get_filesize();
			if (t == filesize_invalid) {
				if (!skipUnknown) return filesize_invalid;
			} else {
				ret += t;
			}
		}
	}
	return ret;
}
开发者ID:exscape,项目名称:foo_simpleserver,代码行数:22,代码来源:metadb_handle_list.cpp


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