KiCad PCB EDA Suite
BIN_MOD Struct Reference

Struct BIN_MOD pertains to a single program module, either an EXE or a DSO/DLL ("bin_mod"). More...

#include <bin_mod.h>

Public Member Functions

 BIN_MOD (const char *aName)
 
 ~BIN_MOD ()
 
void Init ()
 
void End ()
 

Public Attributes

const char * m_name
 name of this binary module, static C string. More...
 
wxConfigBase * m_config
 maybe from $HOME/.${m_name} More...
 
wxFileHistory m_history
 
wxString m_help_file
 
SEARCH_STACK m_search
 

Detailed Description

Struct BIN_MOD pertains to a single program module, either an EXE or a DSO/DLL ("bin_mod").

It manages miscellaneous configuration file information pertinent to one bin_mod. Because it serves in both DSO/DLLs and in EXEs, its name is neutral.

Accessors are in containing (wrapper) classes.

Definition at line 47 of file bin_mod.h.

Constructor & Destructor Documentation

BIN_MOD::BIN_MOD ( const char *  aName)

Definition at line 29 of file bin_mod.cpp.

29  :
30  m_name( aName ),
31  m_config( 0 )
32 {
33 }
wxConfigBase * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:57
const char * m_name
name of this binary module, static C string.
Definition: bin_mod.h:55
BIN_MOD::~BIN_MOD ( )

Definition at line 67 of file bin_mod.cpp.

References End().

68 {
69  End();
70 }
void End()
Definition: bin_mod.cpp:53

Member Function Documentation

void BIN_MOD::End ( )

Definition at line 53 of file bin_mod.cpp.

References m_config, and m_history.

Referenced by PGM_KICAD::Destroy(), KIFACE_I::end_common(), and ~BIN_MOD().

54 {
55  if( m_config )
56  {
57  m_history.Save( *m_config );
58 
59  // Deleting a wxConfigBase writes its contents to disk if changed.
60  // Might be NULL if called twice, in which case nothing happens.
61  delete m_config;
62  m_config = 0;
63  }
64 }
wxFileHistory m_history
Definition: bin_mod.h:58
wxConfigBase * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:57
void BIN_MOD::Init ( )

Definition at line 36 of file bin_mod.cpp.

References GetNewConfig(), m_config, m_help_file, m_history, and m_name.

Referenced by PGM_KICAD::OnPgmInit(), and KIFACE_I::start_common().

37 {
38  // do an OS specific wxConfig instantiation, using the bin_mod (EXE/DLL/DSO) name.
39  m_config = GetNewConfig( wxString::FromUTF8( m_name ) );
40 
41  m_history.Load( *m_config );
42 
43  // Prepare On Line Help. Use only lower case for help file names, in order to
44  // avoid problems with upper/lower case file names under windows and unix.
45  // Help files are now using html format.
46  // Old help files used pdf format.
47  // so when searching a help file, the .html file will be searched,
48  // and if not found, the .pdf file will be searched.
49  m_help_file = wxString::FromUTF8( m_name ); // no ext given. can be .html or .pdf
50 }
wxConfigBase * GetNewConfig(const wxString &aProgName)
Function GetNewConfig.
Definition: common.cpp:205
wxString m_help_file
Definition: bin_mod.h:59
wxFileHistory m_history
Definition: bin_mod.h:58
wxConfigBase * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:57
const char * m_name
name of this binary module, static C string.
Definition: bin_mod.h:55

Member Data Documentation

wxConfigBase* BIN_MOD::m_config

maybe from $HOME/.${m_name}

Definition at line 57 of file bin_mod.h.

Referenced by End(), Init(), KIFACE_I::KifaceSettings(), and PGM_KICAD::PgmSettings().

wxString BIN_MOD::m_help_file

Definition at line 59 of file bin_mod.h.

Referenced by PGM_KICAD::GetHelpFileName(), KIFACE_I::GetHelpFileName(), and Init().

wxFileHistory BIN_MOD::m_history

Definition at line 58 of file bin_mod.h.

Referenced by End(), PGM_KICAD::GetFileHistory(), KIFACE_I::GetFileHistory(), and Init().

const char* BIN_MOD::m_name

name of this binary module, static C string.

Definition at line 55 of file bin_mod.h.

Referenced by Init(), and KIFACE_I::Name().


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