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 ()
 
void InitSettings (APP_SETTINGS_BASE *aPtr)
 Takes ownership of a new application settings object. More...
 

Public Attributes

const char * m_name
 name of this binary module, static C string. More...
 
APP_SETTINGS_BASEm_config
 maybe from $HOME/.${m_name} More...
 
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 48 of file bin_mod.h.

Constructor & Destructor Documentation

◆ BIN_MOD()

BIN_MOD::BIN_MOD ( const char *  aName)

Definition at line 34 of file bin_mod.cpp.

34  :
35  m_name( aName ),
36  m_config( nullptr )
37 {
38 }
APP_SETTINGS_BASE * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:64
const char * m_name
name of this binary module, static C string.
Definition: bin_mod.h:62

◆ ~BIN_MOD()

BIN_MOD::~BIN_MOD ( )

Definition at line 65 of file bin_mod.cpp.

66 {
67 }

Member Function Documentation

◆ End()

void BIN_MOD::End ( )

Definition at line 53 of file bin_mod.cpp.

54 {
55  if( m_config )
56  {
57  // The settings manager will outlive this module so we need to clean up the module level
58  // settings here instead of leaving it up to the manager
59  Pgm().GetSettingsManager().FlushAndRelease( m_config );
60  m_config = nullptr;
61  }
62 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:104
APP_SETTINGS_BASE * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:64

References m_config, and Pgm().

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

◆ Init()

void BIN_MOD::Init ( )

Definition at line 41 of file bin_mod.cpp.

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 }
wxString m_help_file
Definition: bin_mod.h:65
const char * m_name
name of this binary module, static C string.
Definition: bin_mod.h:62

References m_help_file, and m_name.

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

◆ InitSettings()

void BIN_MOD::InitSettings ( APP_SETTINGS_BASE aPtr)
inline

Takes ownership of a new application settings object.

Parameters
aPtris the settings object for this module

Definition at line 60 of file bin_mod.h.

60 { m_config = aPtr; }
APP_SETTINGS_BASE * m_config
maybe from $HOME/.${m_name}
Definition: bin_mod.h:64

References m_config.

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

Member Data Documentation

◆ m_config

APP_SETTINGS_BASE* BIN_MOD::m_config

maybe from $HOME/.${m_name}

Definition at line 64 of file bin_mod.h.

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

◆ m_help_file

wxString BIN_MOD::m_help_file

Definition at line 65 of file bin_mod.h.

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

◆ m_name

const char* BIN_MOD::m_name

name of this binary module, static C string.

Definition at line 62 of file bin_mod.h.

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

◆ m_search


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