foobar2000 SDK  2015-08-03
Public Member Functions | Static Public Member Functions | Data Fields | Private Attributes | Static Private Attributes
cfg_var_writerabstract

#include <cfg_var.h>

+ Inheritance diagram for cfg_var_writer:

Public Member Functions

 cfg_var_writer (const GUID &guid)
 
 ~cfg_var_writer ()
 
virtual void get_data_raw (stream_writer *p_stream, abort_callback &p_abort)=0
 

Static Public Member Functions

static void config_write_file (stream_writer *p_stream, abort_callback &p_abort)
 

Data Fields

const GUID m_guid
 

Private Attributes

cfg_var_writerm_next
 

Static Private Attributes

static cfg_var_writerg_list = NULL
 

Detailed Description

Writer part of cfg_var object. In most cases, you should use cfg_var instead of using cfg_var_writer directly.

Definition at line 31 of file cfg_var.h.

Constructor & Destructor Documentation

cfg_var_writer::cfg_var_writer ( const GUID guid)
inline
Parameters
p_guidGUID of the variable, used to identify variable implementations owning specific configuration file entries when reading the configuration file back. You must generate a new GUID every time you declare a new cfg_var.

Definition at line 34 of file cfg_var.h.

34 : m_guid(guid) { CFG_VAR_ASSERT_SAFEINIT; m_next = g_list; g_list = this;}
static cfg_var_writer * g_list
Definition: cfg_var.h:46
const GUID m_guid
Definition: cfg_var.h:44
cfg_var_writer * m_next
Definition: cfg_var.h:47
cfg_var_writer::~cfg_var_writer ( )
inline

Definition at line 35 of file cfg_var.h.

35 { CFG_VAR_ASSERT_SAFEINIT; }

Member Function Documentation

void cfg_var_writer::config_write_file ( stream_writer p_stream,
abort_callback p_abort 
)
static

For internal use only, do not call.

Definition at line 34 of file cfg_var.cpp.

34  {
35  cfg_var_writer * ptr;
37  for(ptr = g_list; ptr; ptr = ptr->m_next) {
38  temp.set_size(0);
39  {
41  ptr->get_data_raw(&stream,p_abort);
42  }
43  p_stream->write_lendian_t(ptr->m_guid,p_abort);
44  p_stream->write_lendian_t(pfc::downcast_guarded<t_uint32>(temp.get_size()),p_abort);
45  if (temp.get_size() > 0) {
46  p_stream->write_object(temp.get_ptr(),temp.get_size(),p_abort);
47  }
48  }
49 }
const t_item * get_ptr() const
Definition: array.h:213
virtual void get_data_raw(stream_writer *p_stream, abort_callback &p_abort)=0
Retrieves state of the variable. Called only from main thread, when writing configuration file...
void set_size(t_size p_size)
Definition: array.h:104
static cfg_var_writer * g_list
Definition: cfg_var.h:46
Writer part of cfg_var object. In most cases, you should use cfg_var instead of using cfg_var_writer ...
Definition: cfg_var.h:31
t_size get_size() const
Definition: array.h:130
const GUID m_guid
Definition: cfg_var.h:44
cfg_var_writer * m_next
Definition: cfg_var.h:47
virtual void cfg_var_writer::get_data_raw ( stream_writer p_stream,
abort_callback p_abort 
)
pure virtual

Field Documentation

cfg_var_writer * cfg_var_writer::g_list = NULL
staticprivate

Definition at line 46 of file cfg_var.h.

const GUID cfg_var_writer::m_guid

Definition at line 44 of file cfg_var.h.

cfg_var_writer* cfg_var_writer::m_next
private

Definition at line 47 of file cfg_var.h.


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