foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions
unpackerabstract

#include <unpack.h>

+ Inheritance diagram for unpacker:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (unpacker)
 
virtual void open (service_ptr_t< file > &p_out, const service_ptr_t< file > &p_source, abort_callback &p_abort)=0
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Static Public Member Functions

static void g_open (service_ptr_t< file > &p_out, const service_ptr_t< file > &p_source, abort_callback &p_abort)
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Service providing "unpacker" functionality - processes "packed" file (such as a zip file containing a single media file inside) to allow its contents to be accessed transparently.
To access existing unpacker implementations, use unpacker::g_open helper function.
To register your own implementation, use unpacker_factory_t template.

Definition at line 4 of file unpack.h.

Member Function Documentation

unpacker::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( unpacker  )
void unpacker::g_open ( service_ptr_t< file > &  p_out,
const service_ptr_t< file > &  p_source,
abort_callback p_abort 
)
static

Static helper querying existing unpacker implementations until one that successfully opens specified file is found. Attempts to open specified file for unpacking, creates interface to virtual file with uncompressed data on success. When examined file doesn't appear to be one of formats supported by registered unpacker implementations, throws exception_io_data.

Parameters
p_outReceives interface to virtual file with uncompressed data on success.
p_sourceSource file to process.
p_abortabort_callback object signaling user aborting the operation.

Definition at line 6 of file filesystem.cpp.

7 {
10  if (e.first(ptr)) do {
11  p->reopen(p_abort);
12  try {
13  ptr->open(p_out,p,p_abort);
14  return;
15  } catch(exception_io_data const &) {}
16  } while(e.next(ptr));
17  throw exception_io_data();
18 }
bool first(service_ptr_t< t_query > &p_out)
Definition: service.h:581
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
virtual void unpacker::open ( service_ptr_t< file > &  p_out,
const service_ptr_t< file > &  p_source,
abort_callback p_abort 
)
pure virtual

Attempts to open specified file for unpacking, creates interface to virtual file with uncompressed data on success. When examined file doesn't appear to be one of formats supported by this unpacker implementation, throws exception_io_data.

Parameters
p_outReceives interface to virtual file with uncompressed data on success.
p_sourceSource file to process.
p_abortabort_callback object signaling user aborting the operation.

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