Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

configuration.h File Reference

Handles saving and loading of configuration settings. More...

#include "plucker_defines.h"
#include "wx/confbase.h"
#include "wx/fileconf.h"

Go to the source code of this file.


Enumerations

enum   {
  optionCONFIGURATION_COPY_SECTION_TREAT_AS_ABSOLUTE = 1,
  optionCONFIGURATION_COPY_SECTION_FLUSH_AT_END = 2
}
enum   {
  PLUCKERHOME = 0,
  CHANNELS,
  RESOURCES,
  LOCALE,
  HANDHELD_VIEWER_SOFTWARE,
  DOCUMENTATION,
  WXWINDOWS_CONFIGURATION
}
  For calling get_plucker_directory.


Functions

void  init_configuration ()
  Initialize the_configuration.

void  finish_configuration ()
  Finish the_configuration.

wxString  get_configuration_filename ()
  Get a filename of the textfile read and read to by the_configuration.

wxString  get_custom_configuration_filename (const wxString &basename)
  Get a proper platform-specific configuration filename for a given basename.

wxString  get_os_configuration_section ()
  Get the section of the configuration file used by the active OS.

bool  is_channel_section (wxString section)
  Check to see it the section of the configuration file is a channel section.

bool  is_reserved_section (wxString section)
  Check to see it the section of the configuration file is a reserved section.

bool  is_modifier_section (wxString section)
  Check to see it the section of the configuration file is a channel modifier section.

wxString  get_legal_new_channel_section (wxString string_to_convert)
  Get a legal new channel section, based on a suggested string.

wxString  get_pluckerhome_directory ()
  Get the directory of pluckerhome.

wxString  get_plucker_directory (long directory_name)
  Get one of the directories used by plucker.

wxString  get_msw_pluckerhome_from_registry ()
  Get the value of pluckerhome from the registry (MSW only).

void  strip_depreciated_keys (wxString section)
  Strip deprecialted keys from a section.

void  copy_section (wxString from_section, wxString to_section, bool treat_as_absolute)
  Copy all the keys from one section to another.

void  copy_section2 (const wxString &from_section=wxEmptyString, const wxString &to_section=wxEmptyString, long options=optionCONFIGURATION_COPY_SECTION_TREAT_AS_ABSOLUTE|optionCONFIGURATION_COPY_SECTION_FLUSH_AT_END, wxFileConfig *from_configuration=the_configuration, wxFileConfig *to_configuration=the_configuration)
  A new function to replace copy_section, once works okay.

void  copy_all_sections (wxFileConfig *from_configuration, wxFileConfig *to_configuration, long options=optionCONFIGURATION_COPY_SECTION_TREAT_AS_ABSOLUTE|optionCONFIGURATION_COPY_SECTION_FLUSH_AT_END)
  Convenience function to copy all sections from one config file to another.

wxString  protocol_filename_to_normal_fullname (const wxString &input_filename)
  Convert a protocol-prefixed filename to a regular fullname.

wxString  get_protocol_prefix (wxString &input)
  Get the protocol prefix at the front of a string.

void  set_close_on_exit (const wxString &section, bool enabled, bool only_write_if_key_exists, bool flush)
  Sets the close on exit key for the specified section.

void  set_close_on_error (const wxString &section, bool enabled, bool only_write_if_key_exists, bool flush)
  Sets the close on exit key for the specified section.


Variables

wxFileConfig *  the_configuration

Detailed Description

Handles saving and loading of configuration settings.
Modified by:
Copyright:
(c) Robert O'Connor ( rob@medicalmnemonics.com )
Licence:
GPL
Author:
Robert O'Connor
Date:
2001/10/20

Function Documentation

void copy_section wxString    from_section,
wxString    to_section,
bool    treat_as_absolute
 

Copy all the keys from one section to another.

Copies keys from one section to another. Creates to_section if it doesn't exist already. Sections are of the format DEFAULT or MYCHANNEL etc. The treat_as_absolute will just convert the to_section and from_section to absolute paths in the config file, such as /DEFAULT or /MYCHANNEL. [Set treat_as_absolute to FALSE if you want to do some sort of copying of sections within a subgroup]

void set_close_on_error const wxString &    section,
bool    enabled,
bool    only_write_if_key_exists,
bool    flush
 

Sets the close on exit key for the specified section.

Parameters:
section  The configuration section
enabled  TRUE if the close_on_error key should be set to 1
only_write_if_key_exists  TRUE if only should write the key if it exists
flush  Whether to flush the configuration or not
void set_close_on_exit const wxString &    section,
bool    enabled,
bool    only_write_if_key_exists,
bool    flush
 

Sets the close on exit key for the specified section.

Parameters:
section  The configuration section
enabled  TRUE if the close_on_exit key should be set
only_write_if_key_exists  TRUE if only should write the key if it exists
flush  Whether to flush the configuration or not

Variable Documentation

wxFileConfig* the_configuration
 
Todo:
When wx can derive from wxFileConfig, then subclass the configuration.