[ Lit Window Library at SourceForge[ Lit Window Productions Homepage ]  [ wxWidgets Tips&Tricks ]  [  wxVisualSetup ]

Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Serializing objects with data adapters.

These methods serialize all properties of an object using wxConfigBase. More...

Classes

struct  SetPath

Path setters

Changes the path to newPath

wxConfigBase LWWX_API & operator<< (wxConfigBase &cfg, const SetPath &newPath)
wxConfigBase LWWX_API & operator>> (wxConfigBase &cfg, const SetPath &newPath)

Read/Write functions

wxConfigBase LWWX_API & operator<< (wxConfigBase &cfg, const const_accessor &source)
 Write values for the accessor to a Config object.
wxConfigBase LWWX_API & operator>> (wxConfigBase &cfg, const accessor &destination)
 Read values for the accessor from a Config object.

Detailed Description

Use these functions if you want to write or read the value of objects to or from a wxConfig object. This is commonly used to store and load user settings.
Example: Reading values
This example reads the values of a global g_settings variable from wxConfig using the path /settings.
    (*wxConfig::Get()) << SetPath("/settings") << make_const_accessor(g_settings);
Example: Writing values
This example writes the values of the g_settings variable to the wxConfig object.
    (*wxConfig::Get()) >> SetPath("/settings") >> make_accessor(g_settings);

Function Documentation

wxConfigBase LWWX_API& operator<< wxConfigBase &  cfg,
const SetPath newPath
 

wxConfigBase LWWX_API& operator<< wxConfigBase &  cfg,
const const_accessor &  source
 

This function writes the values for all members of the object, including containers and aggregates, to the wxConfig object.

wxConfigBase LWWX_API& operator>> wxConfigBase &  cfg,
const SetPath newPath
 

wxConfigBase LWWX_API& operator>> wxConfigBase &  cfg,
const accessor &  destination
 

This function will read all values for all members of the object, including containers and aggregates. If a value is not present in the configuration storage, the corresponding member will be left unchanged. There are no default values.

Note:
Initialise the object to default values before using this function.


Copyright 2004, Hajo Kirchhoff, Lit Window Productions