metadb Class Reference

#include <metadb.h>

Inheritance diagram for metadb:

service_base

List of all members.

Public Types

enum  { case_sensitive = true }
typedef pfc::comparator_strcmp path_comparator
typedef metadb t_interface_entrypoint
typedef metadb t_interface
typedef service_base t_interface_parent

Public Member Functions

virtual void database_lock ()=0
 Locks metadb to prevent other threads from modifying it while you're working with some of its contents. Some functions (metadb_handle::get_info_locked(), metadb_handle::get_info_async_locked()) can be called only from inside metadb lock section.
virtual void database_unlock ()=0
 Unlocks metadb after database_lock(). Some functions (metadb_handle::get_info_locked(), metadb_handle::get_info_async_locked()) can be called only from inside metadb lock section.
virtual void handle_create (metadb_handle_ptr &p_out, const playable_location &p_location)=0
void handle_create_replace_path_canonical (metadb_handle_ptr &p_out, const metadb_handle_ptr &p_source, const char *p_new_path)
void handle_replace_path_canonical (metadb_handle_ptr &p_out, const char *p_new_path)
void handle_create_replace_path (metadb_handle_ptr &p_out, const metadb_handle_ptr &p_source, const char *p_new_path)

Static Public Member Functions

static bool g_get_random_handle (metadb_handle_ptr &p_out)
static int path_compare_ex (const char *p1, t_size len1, const char *p2, t_size len2)
static int path_compare (const char *p1, const char *p2)
static int path_compare_metadb_handle (const metadb_handle_ptr &p1, const metadb_handle_ptr &p2)

Static Public Attributes

static const GUID class_guid


Detailed Description

Entrypoint service for metadb_handle related operations.
Implemented only by core, do not reimplement.
Use static_api_ptr_t template to access it, e.g. static_api_ptr_t<metadb>()->handle_create(myhandle,mylocation);

Member Typedef Documentation

Reimplemented from service_base.


Member Enumeration Documentation

anonymous enum

Enumerator:
case_sensitive 


Member Function Documentation

virtual void metadb::database_lock (  )  [pure virtual]

Locks metadb to prevent other threads from modifying it while you're working with some of its contents. Some functions (metadb_handle::get_info_locked(), metadb_handle::get_info_async_locked()) can be called only from inside metadb lock section.

virtual void metadb::database_unlock (  )  [pure virtual]

Unlocks metadb after database_lock(). Some functions (metadb_handle::get_info_locked(), metadb_handle::get_info_async_locked()) can be called only from inside metadb lock section.

virtual void metadb::handle_create ( metadb_handle_ptr p_out,
const playable_location p_location 
) [pure virtual]

Returns a metadb_handle object referencing the specified location. If one doesn't exist yet a new one is created. There can be only one metadb_handle object referencing specific location.
This function should never fail unless there's something critically wrong (can't allocate memory for the new object, etc).
Speed: O(log(n)) to total number of metadb_handles present. It's recommended to pass metadb_handles around whenever possible rather than pass playable_locations then retrieve metadb_handles on demand when needed.

Parameters:
p_out Receives the metadb_handle pointer.
p_location Location to create a metadb_handle for.

void metadb::handle_create_replace_path_canonical ( metadb_handle_ptr p_out,
const metadb_handle_ptr p_source,
const char *  p_new_path 
)

void metadb::handle_replace_path_canonical ( metadb_handle_ptr p_out,
const char *  p_new_path 
)

void metadb::handle_create_replace_path ( metadb_handle_ptr p_out,
const metadb_handle_ptr p_source,
const char *  p_new_path 
)

static bool metadb::g_get_random_handle ( metadb_handle_ptr p_out  )  [static]

Helper function; attempts to retrieve a handle to any known playable location to be used for e.g. titleformatting script preview.

Returns:
True on success; false on failure (no known playable locations).

static int metadb::path_compare_ex ( const char *  p1,
t_size  len1,
const char *  p2,
t_size  len2 
) [inline, static]

static int metadb::path_compare ( const char *  p1,
const char *  p2 
) [inline, static]

static int metadb::path_compare_metadb_handle ( const metadb_handle_ptr p1,
const metadb_handle_ptr p2 
) [inline, static]


Member Data Documentation

const GUID metadb::class_guid [static]

Initial value:

 
{ 0x609d48c8, 0xc6a6, 0x4784, { 0x8b, 0xbd, 0xfd, 0xd3, 0x2b, 0xf0, 0x74, 0xe } }


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

Generated on Fri Apr 25 18:49:46 2008 for foobar2000 SDK by  doxygen 1.5.5