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

#include <link_resolver.h>

+ Inheritance diagram for link_resolver:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (link_resolver)
 
virtual bool is_our_path (const char *p_path, const char *p_extension)=0
 
virtual void resolve (service_ptr_t< file > p_filehint, const char *p_path, pfc::string_base &p_out, 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 bool g_find (service_ptr_t< link_resolver > &p_out, const char *p_path)
 

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

Interface for resolving different sorts of link files. Utilized by mechanisms that convert filesystem path into list of playable locations. For security reasons, link may only point to playable object path, not to a playlist or another link.

Definition at line 8 of file link_resolver.h.

Member Function Documentation

link_resolver::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( link_resolver  )
bool link_resolver::g_find ( service_ptr_t< link_resolver > &  p_out,
const char *  p_path 
)
static

Helper function; finds link_resolver interface that supports specified link file.

Parameters
p_outReceives link_resolver interface on success.
p_pathPath of file to query.
Returns
True on success, false on failure (no interface that supports specified path could be found).

Definition at line 3 of file link_resolver.cpp.

4 {
7  pfc::string_extension ext(p_path);
8  while(e.next(ptr))
9  {
10  if (ptr->is_our_path(p_path,ext))
11  {
12  p_out = ptr;
13  return true;
14  }
15  }
16  return false;
17 }
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 bool link_resolver::is_our_path ( const char *  p_path,
const char *  p_extension 
)
pure virtual

Tests whether specified file is supported by this link_resolver service.

Parameters
p_pathPath of file being queried.
p_extensionExtension of file being queried. This is provided for performance reasons, path already includes it.
virtual void link_resolver::resolve ( service_ptr_t< file p_filehint,
const char *  p_path,
pfc::string_base p_out,
abort_callback p_abort 
)
pure virtual

Resolves a link file. Before this is called, path must be accepted by is_our_path().

Parameters
p_filehintOptional file interface to use. If null/empty, implementation should open file by itself.
p_pathPath of link file to resolve.
p_outReceives path the link is pointing to.
p_abortabort_callback object signaling user aborting the operation.

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