cfg_string Class Reference

#include <cfg_var.h>

Inheritance diagram for cfg_string:

cfg_var pfc::string8_t< t_alloc > pfc::string_base pfc::string_receiver

List of all members.

Public Member Functions

 cfg_string (const GUID &p_guid, const char *p_defaultval)
const cfg_stringoperator= (const cfg_string &p_val)
const cfg_stringoperator= (const char *p_val)
 operator const char * () const

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)


Detailed Description

String config variable. Stored in the stream with int32 header containing size in bytes, followed by non-null-terminated UTF-8 data.
Note that cfg_var class and its derivatives may be only instantiated statically (as static objects or members of other static objects), NEVER dynamically (operator new, local variables, members of objects instantiated as such).

Constructor & Destructor Documentation

cfg_string::cfg_string ( const GUID &  p_guid,
const char *  p_defaultval 
) [inline, explicit]

Parameters:
p_guid GUID 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.
p_defaultval Default/initial value of the variable.


Member Function Documentation

void cfg_string::get_data_raw ( stream_writer *  p_stream,
abort_callback &  p_abort 
) [protected, virtual]

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

Parameters:
p_stream Stream receiving state of the variable.

Implements cfg_var.

void cfg_string::set_data_raw ( stream_reader *  p_stream,
t_size  p_sizehint,
abort_callback &  p_abort 
) [protected, virtual]

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

Parameters:
p_stream Stream containing new state of the variable.
p_sizehint Number of bytes contained in the stream; reading past p_sizehint bytes will fail (EOF).

Implements cfg_var.

const cfg_string& cfg_string::operator= ( const cfg_string p_val  )  [inline]

const cfg_string& cfg_string::operator= ( const char *  p_val  )  [inline]

Reimplemented from pfc::string8_t< t_alloc >.

cfg_string::operator const char * (  )  const [inline]

Reimplemented from pfc::string8_t< t_alloc >.


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

Generated on Fri Apr 18 13:56:49 2008 for foobar2000 SDK by  doxygen 1.5.5