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

#include <config_object.h>

+ Inheritance diagram for config_object:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (config_object)
 
virtual void get_data (stream_writer *p_stream, abort_callback &p_abort) const =0
 
void get_data_bool (bool &p_out)
 
bool get_data_bool_simple (bool p_default)
 
void get_data_int32 (t_int32 &p_out)
 
t_int32 get_data_int32_simple (t_int32 p_default)
 
t_size get_data_raw (void *p_out, t_size p_bytes)
 
t_size get_data_raw_length ()
 
void get_data_string (pfc::string_base &p_out)
 
template<class T >
void get_data_struct_t (T &p_out)
 
virtual GUID get_guid () const =0
 
virtual void set_data (stream_reader *p_stream, abort_callback &p_abort, bool p_sendnotify=true)=0
 
void set_data_bool (bool p_val)
 
void set_data_int32 (t_int32 p_val)
 
void set_data_raw (const void *p_data, t_size p_bytes, bool p_sendnotify=true)
 
void set_data_string (const char *p_data, t_size p_length)
 
template<class T >
void set_data_struct_t (const T &p_in)
 
- 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< config_object > &p_out, const GUID &p_guid)
 
static void g_get_data_bool (const GUID &p_guid, bool &p_out)
 
static bool g_get_data_bool_simple (const GUID &p_guid, bool p_default)
 
static void g_get_data_int32 (const GUID &p_guid, t_int32 &p_out)
 
static t_int32 g_get_data_int32_simple (const GUID &p_guid, t_int32 p_default)
 
static void g_get_data_string (const GUID &p_guid, pfc::string_base &p_out)
 
template<class T >
static void g_get_data_struct_t (const GUID &p_guid, T &p_out)
 
static void g_set_data_bool (const GUID &p_guid, bool p_val)
 
static void g_set_data_int32 (const GUID &p_guid, t_int32 p_val)
 
static void g_set_data_string (const GUID &p_guid, const char *p_data, t_size p_length=~0)
 
template<class T >
static void g_set_data_struct_t (const GUID &p_guid, const T &p_in)
 

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

Definition at line 16 of file config_object.h.

Member Function Documentation

config_object::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( config_object  )
bool config_object::g_find ( service_ptr_t< config_object > &  p_out,
const GUID p_guid 
)
static

Definition at line 14 of file config_object.cpp.

15 {
18  while(e.next(ptr))
19  {
20  if (ptr->get_guid() == p_guid)
21  {
22  p_out = ptr;
23  return true;
24  }
25  }
26  return false;
27 }
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
void config_object::g_get_data_bool ( const GUID p_guid,
bool &  p_out 
)
static

Definition at line 103 of file config_object.cpp.

103 {g_get_data_struct_t<bool>(p_guid,p_out);}
bool config_object::g_get_data_bool_simple ( const GUID p_guid,
bool  p_default 
)
static

Definition at line 86 of file config_object.cpp.

87 {
89  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
90  return ptr->get_data_bool_simple(p_default);
91 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
void config_object::g_get_data_int32 ( const GUID p_guid,
t_int32 p_out 
)
static

Definition at line 74 of file config_object.cpp.

74  {
76  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
77  ptr->get_data_int32(p_out);
78 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
t_int32 config_object::g_get_data_int32_simple ( const GUID p_guid,
t_int32  p_default 
)
static

Definition at line 93 of file config_object.cpp.

94 {
96  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
97  return ptr->get_data_int32_simple(p_default);
98 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
void config_object::g_get_data_string ( const GUID p_guid,
pfc::string_base p_out 
)
static

Definition at line 29 of file config_object.cpp.

30 {
32  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
33  ptr->get_data_string(p_out);
34 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
template<class T >
void config_object::g_get_data_struct_t ( const GUID p_guid,
T p_out 
)
static

Definition at line 17 of file config_object_impl.h.

17  {
19  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
20  return ptr->get_data_struct_t<T>(p_out);
21 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
void config_object::g_set_data_bool ( const GUID p_guid,
bool  p_val 
)
static

Definition at line 104 of file config_object.cpp.

104 {g_set_data_struct_t<bool>(p_guid,p_val);}
void config_object::g_set_data_int32 ( const GUID p_guid,
t_int32  p_val 
)
static

Definition at line 80 of file config_object.cpp.

80  {
82  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
83  ptr->set_data_int32(p_val);
84 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
void config_object::g_set_data_string ( const GUID p_guid,
const char *  p_data,
t_size  p_length = ~0 
)
static

Definition at line 36 of file config_object.cpp.

37 {
39  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
40  ptr->set_data_string(p_data,p_length);
41 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
template<class T >
void config_object::g_set_data_struct_t ( const GUID p_guid,
const T p_in 
)
static

Definition at line 24 of file config_object_impl.h.

24  {
26  if (!g_find(ptr,p_guid)) throw exception_service_not_found();
27  return ptr->set_data_struct_t<T>(p_in);
28 }
static bool g_find(service_ptr_t< config_object > &p_out, const GUID &p_guid)
virtual void config_object::get_data ( stream_writer p_stream,
abort_callback p_abort 
) const
pure virtual
void config_object::get_data_bool ( bool &  p_out)

Definition at line 100 of file config_object.cpp.

100 {get_data_struct_t<bool>(p_out);}
bool config_object::get_data_bool_simple ( bool  p_default)

Definition at line 58 of file config_object.cpp.

58  {
59  try {
60  bool ret = p_default;
61  get_data_bool(ret);
62  return ret;
63  } catch(...) {return p_default;}
64 }
void get_data_bool(bool &p_out)
void config_object::get_data_int32 ( t_int32 p_out)

Definition at line 43 of file config_object.cpp.

44 {
45  t_int32 temp;
46  get_data_struct_t<t_int32>(temp);
48  p_out = temp;
49 }
int32_t t_int32
Definition: int_types.h:4
void order_le_to_native_t(T &param)
t_int32 config_object::get_data_int32_simple ( t_int32  p_default)

Definition at line 66 of file config_object.cpp.

66  {
67  try {
68  t_int32 ret = p_default;
69  get_data_int32(ret);
70  return ret;
71  } catch(...) {return p_default;}
72 }
void get_data_int32(t_int32 &p_out)
int32_t t_int32
Definition: int_types.h:4
t_size config_object::get_data_raw ( void *  p_out,
t_size  p_bytes 
)

Definition at line 146 of file config_object.cpp.

146  {
147  t_size ret = 0;
148  stream_writer_fixedbuffer stream(p_out,p_bytes,ret);
149  abort_callback_dummy aborter;
150  get_data(&stream,aborter);
151  return ret;
152 }
abort_callback_impl abort_callback_dummy
virtual void get_data(stream_writer *p_stream, abort_callback &p_abort) const =0
size_t t_size
Definition: int_types.h:48
t_size config_object::get_data_raw_length ( )

Definition at line 154 of file config_object.cpp.

154  {
155  t_size ret = 0;
156  stream_writer_get_length stream(ret);
157  abort_callback_dummy aborter;
158  get_data(&stream,aborter);
159  return ret;
160 }
abort_callback_impl abort_callback_dummy
virtual void get_data(stream_writer *p_stream, abort_callback &p_abort) const =0
size_t t_size
Definition: int_types.h:48
void config_object::get_data_string ( pfc::string_base p_out)

Definition at line 172 of file config_object.cpp.

172  {
173  stream_writer_string stream(p_out);
174  abort_callback_dummy aborter;
175  get_data(&stream,aborter);
176 }
abort_callback_impl abort_callback_dummy
virtual void get_data(stream_writer *p_stream, abort_callback &p_abort) const =0
template<class T >
void config_object::get_data_struct_t ( T p_out)

Definition at line 7 of file config_object_impl.h.

7  {
8  if (get_data_raw(&p_out,sizeof(T)) != sizeof(T)) throw exception_io_data_truncation();
9 }
t_size get_data_raw(void *p_out, t_size p_bytes)
virtual GUID config_object::get_guid ( ) const
pure virtual
virtual void config_object::set_data ( stream_reader p_stream,
abort_callback p_abort,
bool  p_sendnotify = true 
)
pure virtual
void config_object::set_data_bool ( bool  p_val)

Definition at line 101 of file config_object.cpp.

101 {set_data_struct_t<bool>(p_val);}
void config_object::set_data_int32 ( t_int32  p_val)

Definition at line 51 of file config_object.cpp.

52 {
53  t_int32 temp = p_val;
55  set_data_struct_t<t_int32>(temp);
56 }
void order_native_to_le_t(T &param)
int32_t t_int32
Definition: int_types.h:4
void config_object::set_data_raw ( const void *  p_data,
t_size  p_bytes,
bool  p_sendnotify = true 
)

Definition at line 162 of file config_object.cpp.

162  {
163  stream_reader_memblock_ref stream(p_data,p_bytes);
164  abort_callback_dummy aborter;
165  set_data(&stream,aborter,p_notify);
166 }
abort_callback_impl abort_callback_dummy
virtual void set_data(stream_reader *p_stream, abort_callback &p_abort, bool p_sendnotify=true)=0
void config_object::set_data_string ( const char *  p_data,
t_size  p_length 
)

Definition at line 168 of file config_object.cpp.

168  {
169  set_data_raw(p_data,pfc::strlen_max(p_data,p_length));
170 }
t_size strlen_max(const char *ptr, t_size max)
Definition: string_base.h:91
void set_data_raw(const void *p_data, t_size p_bytes, bool p_sendnotify=true)
template<class T >
void config_object::set_data_struct_t ( const T p_in)

Definition at line 12 of file config_object_impl.h.

12  {
13  return set_data_raw(&p_in,sizeof(T));
14 }
void set_data_raw(const void *p_data, t_size p_bytes, bool p_sendnotify=true)

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