foobar2000 SDK  2015-08-03
Static Public Member Functions
file_move_helper

#include <file_move_helper.h>

Static Public Member Functions

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)
 
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_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)
 
static bool g_on_deleted (const pfc::list_base_const_t< const char * > &p_files)
 

Detailed Description

Definition at line 1 of file file_move_helper.h.

Member Function Documentation

t_size file_move_helper::g_filter_dead_files ( pfc::list_base_t< metadb_handle_ptr > &  p_data,
const pfc::list_base_const_t< const char * > &  p_dead 
)
static

Definition at line 31 of file file_move_helper.cpp.

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 }
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)
t_size file_move_helper::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

Definition at line 23 of file file_move_helper.cpp.

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 }
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
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)
size_t t_size
Definition: int_types.h:48
virtual t_size get_count() const =0
t_size file_move_helper::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 
)
static

Definition at line 9 of file file_move_helper.cpp.

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 }
bool bsearch_t(t_compare p_compare, t_param const &p_param, t_size &p_index) const
Definition: list.h:45
virtual void set(t_size n, bool val)=0
size_t t_size
Definition: int_types.h:48
virtual t_size get_count() const =0
static int path_compare(const char *p1, const char *p2)
Definition: metadb.h:245
T get_item(t_size n) const
Definition: list.h:16
bool file_move_helper::g_on_deleted ( const pfc::list_base_const_t< const char * > &  p_files)
static

Definition at line 3 of file file_move_helper.cpp.

4 {
6  return true;
7 }
static void g_on_files_deleted(const pfc::list_base_const_t< const char * > &p_items)

The documentation for this class was generated from the following files: