| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef DOSBOX_CONTROL_H |
| 22 |
#define DOSBOX_CONTROL_H |
| 23 |
|
| 24 |
#ifdef _MSC_VER |
| 25 |
#pragma warning ( disable : 4786 ) |
| 26 |
#pragma warning ( disable : 4290 ) |
| 27 |
#endif |
| 28 |
|
| 29 |
#ifndef DOSBOX_PROGRAMS_H |
| 30 |
#include "programs.h" |
| 31 |
#endif |
| 32 |
#ifndef DOSBOX_SETUP_H |
| 33 |
#include "setup.h" |
| 34 |
#endif |
| 35 |
|
| 36 |
#ifndef CH_LIST |
| 37 |
#define CH_LIST |
| 38 |
#include <list> |
| 39 |
#endif |
| 40 |
|
| 41 |
#ifndef CH_VECTOR |
| 42 |
#define CH_VECTOR |
| 43 |
#include <vector> |
| 44 |
#endif |
| 45 |
|
| 46 |
#ifndef CH_STRING |
| 47 |
#define CH_STRING |
| 48 |
#include <string> |
| 49 |
#endif |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
class Config{ |
| 55 |
public: |
| 56 |
CommandLine * cmdline; |
| 57 |
private: |
| 58 |
std::list<Section*> sectionlist; |
| 59 |
typedef std::list<Section*>::iterator it; |
| 60 |
typedef std::list<Section*>::reverse_iterator reverse_it; |
| 61 |
typedef std::list<Section*>::const_iterator const_it; |
| 62 |
typedef std::list<Section*>::const_reverse_iterator const_reverse_it; |
| 63 |
void (* _start_function)(void); |
| 64 |
bool secure_mode; |
| 65 |
public: |
| 66 |
Config(CommandLine * cmd):cmdline(cmd),secure_mode(false){} |
| 67 |
~Config(); |
| 68 |
|
| 69 |
Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*)); |
| 70 |
Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false); |
| 71 |
|
| 72 |
Section* GetSection(int index); |
| 73 |
Section* GetSection(std::string const&_sectionname) const; |
| 74 |
Section* GetSectionFromProperty(char const * const prop) const; |
| 75 |
|
| 76 |
void SetStartUp(void (*_function)(void)); |
| 77 |
void Init(); |
| 78 |
void ShutDown(); |
| 79 |
void StartUp(); |
| 80 |
bool PrintConfig(char const * const configfilename) const; |
| 81 |
bool ParseConfigFile(char const * const configfilename); |
| 82 |
void ParseEnv(char ** envp); |
| 83 |
bool SecureMode() const { return secure_mode; } |
| 84 |
void SwitchToSecureMode() { secure_mode = true; } |
| 85 |
}; |
| 86 |
|
| 87 |
#endif |