|
1
|
1 #pragma once
|
|
|
2
|
|
|
3 //! Interface for resolving different sorts of link files.
|
|
|
4 //! Utilized by mechanisms that convert filesystem path into list of playable locations.
|
|
|
5 //! For security reasons, link may only point to playable object path, not to a playlist or another link.
|
|
|
6
|
|
|
7 class NOVTABLE link_resolver : public service_base
|
|
|
8 {
|
|
|
9 public:
|
|
|
10
|
|
|
11 //! Tests whether specified file is supported by this link_resolver service.
|
|
|
12 //! @param p_path Path of file being queried.
|
|
|
13 //! @param p_extension Extension of file being queried. This is provided for performance reasons, path already includes it.
|
|
|
14 virtual bool is_our_path(const char * p_path,const char * p_extension) = 0;
|
|
|
15
|
|
|
16 //! Resolves a link file. Before this is called, path must be accepted by is_our_path().
|
|
|
17 //! @param p_filehint Optional file interface to use. If null/empty, implementation should open file by itself.
|
|
|
18 //! @param p_path Path of link file to resolve.
|
|
|
19 //! @param p_out Receives path the link is pointing to.
|
|
|
20 //! @param p_abort abort_callback object signaling user aborting the operation.
|
|
|
21 virtual void resolve(service_ptr_t<file> p_filehint,const char * p_path,pfc::string_base & p_out,abort_callback & p_abort) = 0;
|
|
|
22
|
|
|
23 //! Helper function; finds link_resolver interface that supports specified link file.
|
|
|
24 //! @param p_out Receives link_resolver interface on success.
|
|
|
25 //! @param p_path Path of file to query.
|
|
|
26 //! @returns True on success, false on failure (no interface that supports specified path could be found).
|
|
|
27 static bool g_find(service_ptr_t<link_resolver> & p_out,const char * p_path);
|
|
|
28
|
|
|
29 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(link_resolver);
|
|
|
30 };
|