foobar2000 SDK  2015-08-03
Public Member Functions | Protected Member Functions | Private Attributes
cfg_string_mt

#include <cfg_var.h>

+ Inheritance diagram for cfg_string_mt:

Public Member Functions

 cfg_string_mt (const GUID &id, const char *defVal)
 
void get (pfc::string_base &out) const
 
void set (const char *val, t_size valLen=~0)
 
- Public Member Functions inherited from cfg_var
GUID get_guid () const
 
- Public Member Functions inherited from cfg_var_reader
 cfg_var_reader (const GUID &guid)
 
 ~cfg_var_reader ()
 
- Public Member Functions inherited from cfg_var_writer
 cfg_var_writer (const GUID &guid)
 
 ~cfg_var_writer ()
 

Protected Member Functions

void get_data_raw (stream_writer *p_stream, abort_callback &p_abort)
 
void set_data_raw (stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)
 
- Protected Member Functions inherited from cfg_var
 cfg_var (const GUID &p_guid)
 

Private Attributes

critical_section m_sync
 
pfc::string8 m_val
 

Additional Inherited Members

- Static Public Member Functions inherited from cfg_var_reader
static void config_read_file (stream_reader *p_stream, abort_callback &p_abort)
 
- Static Public Member Functions inherited from cfg_var_writer
static void config_write_file (stream_writer *p_stream, abort_callback &p_abort)
 
- Data Fields inherited from cfg_var_reader
const GUID m_guid
 
- Data Fields inherited from cfg_var_writer
const GUID m_guid
 

Detailed Description

Definition at line 114 of file cfg_var.h.

Constructor & Destructor Documentation

cfg_string_mt::cfg_string_mt ( const GUID id,
const char *  defVal 
)
inline

Definition at line 126 of file cfg_var.h.

126 : cfg_var(id), m_val(defVal) {}
pfc::string8 m_val
Definition: cfg_var.h:137
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57

Member Function Documentation

void cfg_string_mt::get ( pfc::string_base out) const
inline

Definition at line 127 of file cfg_var.h.

127  {
128  insync(m_sync);
129  out = m_val;
130  }
pfc::string8 m_val
Definition: cfg_var.h:137
critical_section m_sync
Definition: cfg_var.h:136
void cfg_string_mt::get_data_raw ( stream_writer p_stream,
abort_callback p_abort 
)
inlineprotectedvirtual

Retrieves state of the variable. Called only from main thread, when writing configuration file.

Parameters
p_streamStream receiving state of the variable.

Implements cfg_var_writer.

Definition at line 116 of file cfg_var.h.

116  {
117  insync(m_sync);
118  p_stream->write_object(m_val.get_ptr(),m_val.length(),p_abort);
119  }
pfc::string8 m_val
Definition: cfg_var.h:137
const char * get_ptr() const
Definition: string_base.h:382
critical_section m_sync
Definition: cfg_var.h:136
t_size length() const
For compatibility with old conventions.
Definition: string_base.h:209
void cfg_string_mt::set ( const char *  val,
t_size  valLen = ~0 
)
inline

Definition at line 131 of file cfg_var.h.

131  {
132  insync(m_sync);
133  m_val.set_string(val, valLen);
134  }
pfc::string8 m_val
Definition: cfg_var.h:137
void set_string(const char *p_string, t_size p_length=~0)
Definition: string8_impl.h:15
critical_section m_sync
Definition: cfg_var.h:136
void cfg_string_mt::set_data_raw ( stream_reader p_stream,
t_size  p_sizehint,
abort_callback p_abort 
)
inlineprotectedvirtual

Sets state of the variable. Called only from main thread, when reading configuration file.

Parameters
p_streamStream containing new state of the variable.
p_sizehintNumber of bytes contained in the stream; reading past p_sizehint bytes will fail (EOF).

Implements cfg_var_reader.

Definition at line 120 of file cfg_var.h.

120  {
122  p_stream->read_string_raw(temp,p_abort);
123  set(temp);
124  }
string8_t< pfc::alloc_fast_aggressive > string8_fastalloc
Definition: string_base.h:436

Field Documentation

critical_section cfg_string_mt::m_sync
mutableprivate

Definition at line 136 of file cfg_var.h.

pfc::string8 cfg_string_mt::m_val
private

Definition at line 137 of file cfg_var.h.


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