foobar2000 SDK  2015-08-03
file_operation_callback.h
Go to the documentation of this file.
1 #ifndef _FILE_OPERATION_CALLBACK_H_
2 #define _FILE_OPERATION_CALLBACK_H_
3 
5 
6 class NOVTABLE file_operation_callback : public service_base {
7 public:
10  virtual void on_files_deleted_sorted(t_pathlist p_items) = 0;
12  virtual void on_files_moved_sorted(t_pathlist p_from,t_pathlist p_to) = 0;
14  virtual void on_files_copied_sorted(t_pathlist p_from,t_pathlist p_to) = 0;
15 
16  static void g_on_files_deleted(const pfc::list_base_const_t<const char *> & p_items);
17  static void g_on_files_moved(const pfc::list_base_const_t<const char *> & p_from,const pfc::list_base_const_t<const char *> & p_to);
18  static void g_on_files_copied(const pfc::list_base_const_t<const char *> & p_from,const pfc::list_base_const_t<const char *> & p_to);
19 
20  static bool g_search_sorted_list(const pfc::list_base_const_t<const char*> & p_list,const char * p_string,t_size & p_index);
21  static bool g_update_list_on_moved(metadb_handle_list_ref p_list,t_pathlist p_from,t_pathlist p_to);
22 
23  static bool g_update_list_on_moved_ex(metadb_handle_list_ref p_list,t_pathlist p_from,t_pathlist p_to, metadb_handle_list_ref itemsAdded, metadb_handle_list_ref itemsRemoved);
24 
25  static bool g_mark_dead_entries(metadb_handle_list_cref items, bit_array_var & mask, t_pathlist deadPaths);
26 
27 
28  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(file_operation_callback);
29 };
30 
31 
32 
35 public:
37  virtual void on_files_deleted_sorted(const pfc::list_base_const_t<const char *> & p_items) = 0;
39  virtual void on_files_moved_sorted(const pfc::list_base_const_t<const char *> & p_from,const pfc::list_base_const_t<const char *> & p_to) = 0;
41  virtual void on_files_copied_sorted(const pfc::list_base_const_t<const char *> & p_from,const pfc::list_base_const_t<const char *> & p_to) = 0;
42 };
43 
46 public:
47  virtual void register_callback(file_operation_callback_dynamic * p_callback) = 0;
48  virtual void unregister_callback(file_operation_callback_dynamic * p_callback) = 0;
49 
50  FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(file_operation_callback_dynamic_manager);
51 };
52 
55 public:
58 
62 
63  PFC_CLASS_NOT_COPYABLE_EX(file_operation_callback_dynamic_impl_base);
64 };
65 
66 #endif //_FILE_OPERATION_CALLBACK_H_
void on_files_moved_sorted(const pfc::list_base_const_t< const char * > &p_from, const pfc::list_base_const_t< const char * > &p_to)
p_from is a metadb::path_compare sorted list of files that have been moved, p_to is a list of corresp...
const pfc::list_base_const_t< const char * > & t_pathlist
size_t t_size
Definition: int_types.h:48
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
Definition: service.h:333
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
void on_files_deleted_sorted(const pfc::list_base_const_t< const char * > &p_items)
p_items is a metadb::path_compare sorted list of files that have been deleted.
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
Interface to notify component system about files being deleted or moved. Operates in app&#39;s main threa...
void on_files_copied_sorted(const pfc::list_base_const_t< const char * > &p_from, const pfc::list_base_const_t< const char * > &p_to)
p_from is a metadb::path_compare sorted list of files that have been copied, p_to is a list of corres...