foobar2000 SDK  2015-08-03
file_move_helper.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 
4 {
6  return true;
7 }
8 
10 {
11  t_size n, m = p_data.get_count();
12  t_size found = 0;
13  for(n=0;n<m;n++)
14  {
15  t_size dummy;
16  bool dead = p_dead.bsearch_t(metadb::path_compare,p_data.get_item(n)->get_path(),dummy);
17  if (dead) found++;
18  p_mask.set(n,dead);
19  }
20  return found;
21 }
22 
24 {
25  bit_array_bittable mask(p_data.get_count());
26  t_size found = g_filter_dead_files_sorted_make_mask(p_data,p_dead,mask);
27  if (found > 0) p_data.remove_mask(mask);
28  return found;
29 }
30 
32 {
34  temp.add_items(p_dead);
35  temp.sort_t(metadb::path_compare);
36  return g_filter_dead_files_sorted(p_data,temp);
37 }
38 
Generic variable bit_array implementation. Needs to be initialized with requested array size before ...
void remove_mask(const bit_array &mask)
Definition: list.h:212
bool bsearch_t(t_compare p_compare, t_param const &p_param, t_size &p_index) const
Definition: list.h:45
static t_size g_filter_dead_files_sorted_make_mask(pfc::list_base_t< metadb_handle_ptr > &p_data, const pfc::list_base_const_t< const char * > &p_dead, bit_array_var &p_mask)
virtual void set(t_size n, bool val)=0
size_t t_size
Definition: int_types.h:48
static void g_on_files_deleted(const pfc::list_base_const_t< const char * > &p_items)
virtual t_size get_count() const =0
Bit array interface class, variable version (you can both set and retrieve values). As with the constant version, valid index range depends on the context.
Definition: bit_array.h:40
static int path_compare(const char *p1, const char *p2)
Definition: metadb.h:245
static t_size g_filter_dead_files_sorted(pfc::list_base_t< metadb_handle_ptr > &p_data, const pfc::list_base_const_t< const char * > &p_dead)
static t_size g_filter_dead_files(pfc::list_base_t< metadb_handle_ptr > &p_data, const pfc::list_base_const_t< const char * > &p_dead)
T get_item(t_size n) const
Definition: list.h:16
static bool g_on_deleted(const pfc::list_base_const_t< const char * > &p_files)